S
shapper
Hello,
I am creating a ListView at runtime and so I need to implement
ItemTemplate which inherits ITemplate.
I added a label to ItemTemplate and I need to data binding it to get
the value of "Name" from the ListView data source.
I am having problems in doing this.
For a GridView ItemTemplate the code would be something like:
Private Sub lName_DataBinding(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim lName As Label = CType(sender, Label)
Dim gvrContainer As GridViewRow = CType(lName.NamingContainer,
GridViewRow)
lName.Text = DataBinder.Eval(gvrContainer.DataItem, "Name")
End Sub
Could someone, please help me out?
Thanks,
Miguel
I am creating a ListView at runtime and so I need to implement
ItemTemplate which inherits ITemplate.
I added a label to ItemTemplate and I need to data binding it to get
the value of "Name" from the ListView data source.
I am having problems in doing this.
For a GridView ItemTemplate the code would be something like:
Private Sub lName_DataBinding(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim lName As Label = CType(sender, Label)
Dim gvrContainer As GridViewRow = CType(lName.NamingContainer,
GridViewRow)
lName.Text = DataBinder.Eval(gvrContainer.DataItem, "Name")
End Sub
Could someone, please help me out?
Thanks,
Miguel