Last post Dec 02, 2007 10:53 PM by Nai-Dong Jin - MSFT
Nov 29, 2007 08:16 AM|yusha|LINK
I have to customize a GridView a lot. Therefore i override the GridView Class and esp. the RenderControl Method.
There i have to set the css classes and so on for the rows.
public override void RenderControl(HtmlTextWriter writer)
HeaderRow.Attributes["class"] = HeaderStyle.CssClass;
Assigning the css styles to rows (tr, th etc.) is no problem, but how to get the css info for each cell ?
<ItemStyle class="foo" />
---- inside the cell
Dec 02, 2007 10:53 PM|Nai-Dong Jin - MSFT|LINK
From your description, it seems that you want to assign the CSSClass attribute to the cell in your gridview, right?
Generally, there are 6 fields which can be used in your gridview, They are BoundField, ButtonField,.. and TemplateField, in each of the the field, there’s a ControlStyle-CssClass attribute which is for the CssClass of that filed. You may use that to assign