![]() |
Setting DataList EditItemTemplate Properties
Hello All
I Created a DataList and when the user Selects a Item for Edit, I want to change the CssClass TextBox Properties based on if the Item is a Item or Alternating Item. Item => EditLastName.CssClass = "WhiteBox" AlternatingItem => EditLastName.CssClass = "GreyBox" How do I set these properties in the ItemBound Event? <asp:DataList ....> <EditItemTemplate> <asp:LinkButton runat="server" Text="Update" CommandName="Update" ID="Linkbutton1" /> <asp:LinkButton runat="server" Text="Cancel" CommandName="Cancel" ID="Linkbutton2" /> <asp:DropDownList runat="server" ID="EditTitle" DataSource='<%# TitlesOfCourtesy %>' SelectedIndex='<%# GetSelectedTitle(DataBinder.Eval(Container.DataIte m, "TitleOfCourtesy")) %>' /> <asp:TextBox runat="server" ID="EditLastName" Text='<%# DataBinder.Eval(Container.DataItem, "LastName") %>' /> <asp:TextBox runat="server" ID="EditFirstName" Text='<%# DataBinder.Eval(Container.DataItem, "FirstName") %>' /> </EditItemTemplate> </asp:DataList> Thanks Stuart |
| All times are GMT. The time now is 10:21 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.