R
rockdale.green
Hi, All
I have an datagrid with alternating color, I also want the back-color
of my textbox in ItemTemplate also appears alternating, how could I do
that?
<asp:datagrid id="dgridEmpHours" width="100%" runat="server"
DataKeyField="employee_key" AutoGenerateColumns="False"
BorderWidth="0" CellPadding="2" cellSpacing="1"
GridLines="None" ShowFooter="True">
<AlternatingItemStyle CssClass="AltBoldtext" />
<ItemStyle CssClass="Boldtext" />
<Columns>
<asp:TemplateColumn SortExpression="employee_Key" HeaderText="employee
Key">
<ItemTemplate>
<asp:Label id="lblEmployeeKey" Visible=False runat="server"
Text='<%# DataBinder.Eval(Container, "DataItem.employee_key") %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn SortExpression="hours" HeaderText="Hours" >
<ItemTemplate>
<asp:TextBox id=txtHours runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.Hours") %>'>
</asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>
Thanks a lot
-Rockdale
I have an datagrid with alternating color, I also want the back-color
of my textbox in ItemTemplate also appears alternating, how could I do
that?
<asp:datagrid id="dgridEmpHours" width="100%" runat="server"
DataKeyField="employee_key" AutoGenerateColumns="False"
BorderWidth="0" CellPadding="2" cellSpacing="1"
GridLines="None" ShowFooter="True">
<AlternatingItemStyle CssClass="AltBoldtext" />
<ItemStyle CssClass="Boldtext" />
<Columns>
<asp:TemplateColumn SortExpression="employee_Key" HeaderText="employee
Key">
<ItemTemplate>
<asp:Label id="lblEmployeeKey" Visible=False runat="server"
Text='<%# DataBinder.Eval(Container, "DataItem.employee_key") %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
<asp:TemplateColumn SortExpression="hours" HeaderText="Hours" >
<ItemTemplate>
<asp:TextBox id=txtHours runat="server" Text='<%#
DataBinder.Eval(Container, "DataItem.Hours") %>'>
</asp:TextBox>
</ItemTemplate>
</asp:TemplateColumn>
Thanks a lot
-Rockdale