How to provide gridview first column to the left of gridview?

<asp:GridView ID="grdUploadedFiles" runat="server" AutoGenerateColumns="False" AllowPaging="True" PageSize="7" DataKeyNames="ID" OnRowEditing="grdUploadedFiles_RowEditing" OnRowUpdating="grdUploadedFiles_RowUpdating" OnRowCancelingEdit="grdUploadedFiles_RowCancelingEdit" OnRowDeleting="grdUploadedFiles_RowDeleting" ShowFooter="True" ForeColor="Black" GridLines="Vertical" Width="439px" BackColor="White" BorderColor="#999999" BorderStyle="Solid" Font-Size="Small" Font-Names="Arial" CellPadding="3" BorderWidth="1px"> <Columns> <asp:TemplateField HeaderText="Type" HeaderStyle-HorizontalAlign="Center" > <ItemTemplate> <asp:Label ID="lblType" runat="server" Text='<%# Bind("FileType") %>'></asp:Label> </ItemTemplate> <asp:CommandField ShowEditButton="True"> <ItemStyle/> </asp:CommandField></column></gridview> 

I am using the code above for my gridview.and I want to give an addition to my 1st column. I also want to give a link to the edit and delete link in my gridview. To do this, if I give textuderline = 'true' when editing it, it displays β€œUpdate Delete” as one underline that looks ugly. Is there another way?

+4
source share
1 answer

I suggest using a CSS selector for styling instead of using control properties (which generates an inline style that is difficult to maintain / modify) - if you applied the css class myGridView to the grid view, use CSS, for example

 table.myGridView { color: black; border: solid 1px #999999; background-color: white; width: 439px; font-family: arial; } table.myGridView th { // style your column headings } table.myGridView td { // style your cells padding: 3px; } table.myGridView tr td:first-child { // style the first cell in each row padding-left: 10px; } 
+2
source

All Articles