ListView Bind

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top