Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Setting DataList EditItemTemplate Properties

Thread Tools

Setting DataList EditItemTemplate Properties

Stuart Shay
Posts: n/a
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?

<aspataList ....>

<asp:LinkButton runat="server" Text="Update" CommandName="Update"
ID="Linkbutton1" />
<asp:LinkButton runat="server" Text="Cancel" CommandName="Cancel"
ID="Linkbutton2" />
<aspropDownList 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") %>' />



Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Entering DataList EditItemTemplate from Outside of the DataList Luis Esteban Valencia ASP .Net 1 01-06-2005 07:32 PM
how do i access a dropdownlists selected value in a datagrid edititemtemplate column from the selectedindexchanged event of another dropdownlist in a datagrid edititemtemplate column Dave M ASP .Net Datagrid Control 0 12-14-2004 11:53 AM
Setting up a datalist control - Item_DataBound for a datalist in a datalist Nevyn Twyll ASP .Net 8 09-09-2004 10:13 PM
Click event in a datalist to post back datalist properties Steve Lloyd ASP .Net 1 05-26-2004 04:07 AM
Datalist EditItemTemplate SStory ASP .Net 0 08-18-2003 11:01 PM