Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Setting DataList EditItemTemplate Properties (http://www.velocityreviews.com/forums/t93311-setting-datalist-edititemtemplate-properties.html)

Stuart Shay 12-26-2004 05:44 AM

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.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57