elicialipeego
New Member
Hi,<BR><BR>I've read a couple of articles that show how to put a DropDownList in a DataGrid, but I can't even get the Label working in the ItemTemplate, let alone move on to the DropDownList!<BR><BR>I've seen code examples like this:<BR><BR><asp:TemplateColumn HeaderText="Account"><BR> <ItemTemplate><BR> <asp:Label ID="lblAccount" runat="server" Text='<%# Container.DataItem("AccountID")%>'></asp:Label><BR> </ItemTemplate><BR> ... ddl here<BR></asp:TemplateColumn><BR><BR>I can't get this to work? My Label doesn't seem to have a 'text' property at all(it doesn't appear in the fancy IDE drop down)?<BR><BR>I notice that, when I put a label on a page (not in a DataGrid), there is no "text" property (as you see in the properties window), but the text does go between the label's tags.<BR><BR>Were these articles written before ASP.NET Rev1, and maybe things have changed? Or, am I not doing something properly?<BR><BR>Please help!<BR>ThanksTry putting the Databinder.Eval before the Containter.DataItem("AccountID"). I just tested this code and it works:<BR><BR><ItemTemplate> <BR> <asp:label id="Label1" Runat="server" Text='<%# Databinder.Eval(Container.DataItem, "AccountID") %>'><BR> </asp:label><BR></ItemTemplate> <BR><BR>Greg