DataGrid Autoformatting & CSS
From:
<asp:DataGrid id=FooDataGrid BorderColor="#999999" BorderStyle="None" BorderWidth="1px" BackColor="White" CellPadding="3" GridLines="Vertical" runat="server"> <SELECTEDITEMSTYLE BackColor="#008A8C" ForeColor="White" Font-Bold="True"> <ALTERNATINGITEMSTYLE BackColor="#DCDCDC"> <ITEMSTYLE BackColor="#EEEEEE" ForeColor="Black"> <HEADERSTYLE BackColor="#000084" ForeColor="White" Font-Bold="True"> <FOOTERSTYLE BackColor="#CCCCCC" ForeColor="Black"> <PAGERSTYLE BackColor="#999999" ForeColor="Black" Mode="NumericPages" HorizontalAlign="Center">
To:
<asp:DataGrid id=FooDataGrid BorderStyle="None" BorderWidth="1px" CellPadding="3" GridLines="Vertical" runat="server" CssClass="SessionSearchDataGrid"> <SELECTEDITEMSTYLE CssClass="SessionSearchSelectedItemStyle"> <ALTERNATINGITEMSTYLE CssClass="SessionSearchAlternatingItemStyle"> <ITEMSTYLE CssClass="SessionSearchItemStyle"> <HEADERSTYLE CssClass="SessionSearchHeaderStyle"> <FOOTERSTYLE CssClass="SessionSearchFooterStyle"> <PAGERSTYLE Mode="NumericPages" CssClass="SessionSearchPagerStyle">
and something along the lines of the equivalent CSS:
.SessionSearchDataGrid { background-color: white; border-color: #999999; }etc...
1 Comment
Comments have been disabled for this content.
Dave said
Sounds like a job for regular expressions.