How to make textbox in datagrid appears alternating back-color?

R

rockdale

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top