M
Matt
I have a datagrid that is using some custom styles very nicely by
using the following code:
<aspataGrid id="DataGrid1" runat="server" Width="828px"
ShowFooter="True" >
<SelectedItemStyle CssClass="DataGrid_SelectedItemStyle"></SelectedItemStyle>
<ItemStyle CssClass="DataGrid_ItemStyle"></ItemStyle>
<HeaderStyle CssClass="DataGrid_HeaderStyle"></HeaderStyle>
<FooterStyle CssClass="DataGrid_FooterStyle"></FooterStyle>
<Columns> ...
The problem is that I want to set the width of SOME columns with a
style sheet setting. The only way I found to control the width was to
hard code it in the column definition. Here's a template column that
works:
<asp:TemplateColumn HeaderText="FTE">
<HeaderStyle Width="10px"></HeaderStyle>
<ItemStyle Width="10px"></ItemStyle>
<FooterStyle Width="10px"></FooterStyle>
<ItemTemplate>
<asp:Label id="lblFTE" Width="40px" runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "fte") %>'>
</asp:Label></ItemTemplate>
<FooterTemplate>
<asp:textbox id="txtFTE_Add" Width="40px" Text=""
Runat="server"></asp:textbox>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox id="txtFTE_Edit" Width="40px" runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "fte") %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
I tried using the cssclass="abc" parm inside each template declaration
but that had zero effect.
I want someway to set the individual column width using Styles.css so
I can change it quickly for several columns at once. Any ideas?
using the following code:
<aspataGrid id="DataGrid1" runat="server" Width="828px"
ShowFooter="True" >
<SelectedItemStyle CssClass="DataGrid_SelectedItemStyle"></SelectedItemStyle>
<ItemStyle CssClass="DataGrid_ItemStyle"></ItemStyle>
<HeaderStyle CssClass="DataGrid_HeaderStyle"></HeaderStyle>
<FooterStyle CssClass="DataGrid_FooterStyle"></FooterStyle>
<Columns> ...
The problem is that I want to set the width of SOME columns with a
style sheet setting. The only way I found to control the width was to
hard code it in the column definition. Here's a template column that
works:
<asp:TemplateColumn HeaderText="FTE">
<HeaderStyle Width="10px"></HeaderStyle>
<ItemStyle Width="10px"></ItemStyle>
<FooterStyle Width="10px"></FooterStyle>
<ItemTemplate>
<asp:Label id="lblFTE" Width="40px" runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "fte") %>'>
</asp:Label></ItemTemplate>
<FooterTemplate>
<asp:textbox id="txtFTE_Add" Width="40px" Text=""
Runat="server"></asp:textbox>
</FooterTemplate>
<EditItemTemplate>
<asp:TextBox id="txtFTE_Edit" Width="40px" runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "fte") %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>
I tried using the cssclass="abc" parm inside each template declaration
but that had zero effect.
I want someway to set the individual column width using Styles.css so
I can change it quickly for several columns at once. Any ideas?