You didn't show your server-side code, but the asp.net code should look
something like this:
<asp:TemplateColumn HeaderText="Label">
<ItemTemplate>
<asp:Label id="Label1" runat="server"
Text='<%#Container.DataItem("FirstName")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
Private Sub DataGrid1_ItemDataBound _
(ByVal sender As Object, _
ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) _
Handles DataGrid1.ItemDataBound
Dim lbl As Label
lbl = e.Item.FindControl("Label1")
If Not IsNothing(lbl) Then
lbl.Text = "Hello..." & lbl.Text
End If
End Sub
"SWATHI ALLU" <sw*********@verizon.net> wrote in message
news:eJ***************@TK2MSFTNGP09.phx.gbl...
Hi, I am having a problem thats really driving me nuts, i have a datagrid
and one of the labels is initialised with a database value
using the <%#Container.DataItem("something") %>
now when i do this, the code behind file is not recognizing the label
control. Any work arounds for this?
thanks in advance
-K