3

In design page we can set AlternatingRowStyle ,HeaderStyle ,RowStyle ..etc css properties of a gridview like

    <AlternatingRowStyle CssClass="altrowstyle" />
    <HeaderStyle CssClass="headerstyle" />
    <RowStyle CssClass="rowstyle" />

i am only able to set css properties for dynamically generated gridview in code behind page by gv.CssClass = "tablestyle";.But how can i apply css for AlternatingRowStyle ,HeaderStyle ,RowStyle properties for dynamically generated gridview??

Thanx

4

1 回答 1

5

Actually the very same way:

gv.AlternatingRowStyle.CssClass = "altrowstyle";
gv.HeaderStyle.CssClass = "headerstyle";
gv.RowStyle.CssClass = "rowstyle";
于 2013-06-24T07:40:18.297 回答