asp.net - How to design a GridView? -


I have followed GridView in my ASP.Net page:

It should look like this: (By my designer in Made Photoshop)

(header background is a file)

I tried a lot, but it seems very difficult to design it is my code:

  & Lt; Asp: GridView id = "items grid" allow runat = "server" paging = "true" autoconnect column = "fail" = datasource id = "imeiEntryDataSource" OnRowDataBound = "GvItems_RowDataBound" onsorting = "itemsGrid_Sorting" border collar = "gray "& Gt; & Lt; Columns & gt; & Lt; ASP: BoundfieldDefined = "IMEI" headerText = "IMEI" sortExpress = "IMEI" & gt; & Lt; Item style width = "200px" horizontal align = "center" /> & Lt; / ASP: BoundField & gt; & Lt; ASP: BoundfieldDefined = "StoneOnLost" header text = "status" sortexpress = "StoneOlLust" & gt; & Lt; Item style width = "100px" horizontal algebra = "center" /> & Lt; / ASP: BoundField & gt; & Lt; ASP: Boundfield Dated Field = "Name" HeaderTax = "Name" Sorted Expression = "Name" & gt; & Lt; Item style width = "300px" horizontal align = "center" /> & Lt; / ASP: BoundField & gt; & Lt; ASP: Template Fielded Itemtyte-Width = "150px" Item Style-Horizontal Algarin = "Center" Object System-Vertical Aligns = "Middle" Header Text = "Details" & gt; & Lt; ItemTemplate & gt; & Lt; Asp: Label ID = "descriptionLabel" runat = "server" text = "XXX" & gt; & Lt; / Asp: Label & gt; & Lt; / ItemTemplate & gt; & Lt; / ASP: TemplateField & gt; & Lt; Asp: TemplateField Item Style-width = "180px" Item-Style-Horizontal Alliance = "Center" Item System-Vertical Align = "Middle" Header Text = "Enter" "" & Lt; ItemTemplate & gt; & Lt; ASP: label id = "datetimeLabel" runat = "server" text = "XXX" & gt; & Lt; / Asp: label & gt; & Lt; / ItemTemplate & gt; & Lt; / ASP: TemplateField & gt; & Lt; ASP: Template Fielded Item Style-width = "20px" Item Style-Horizontal Alignment = "Center" Item Style-Vertical Aligns = "Middle" Header Text = "" & gt; & Lt; ItemTemplate & gt; & Lt; Asp: hyperlink id = "description link" run = "server" & gt; & Lt; Asp: image id = "imgDetails" ImageUrl = "~ / Images / Little / search.png" runat = "server" width = "20px" height = "20px" /> & Lt; / ASP: Hyperlink & gt; & Lt; / ItemTemplate & gt; & Lt; / ASP: TemplateField & gt; & Lt; / Column & gt; & Lt; / ASP: GridView & gt;  

If you use CSS for it and keep elements in style This will be very easy for you, which are provided by Gridview. You should start your Gridview before giving a CssClass name so that your style does not mess with other tables on the site. I suggest a device such as firebug to help you see the result of your gridview. If I miss the fact that you give Gridview a CssClass of 'Grid' then you should be able to do something like this, if the header row is presented as th:

 < Code> .grid th {background: Url ('whatever.png') repeat-x;}  

Comments