ListView Bind

Discussion in 'ASP .Net' started by shapper, Nov 18, 2007.

  1. shapper

    shapper Guest

    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
     
    shapper, Nov 18, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mr2_93
    Replies:
    1
    Views:
    3,650
    mr2_93
    Oct 2, 2005
  2. Replies:
    0
    Views:
    605
  3. Jeremy S
    Replies:
    4
    Views:
    9,090
    Jeremy S.
    Jul 15, 2009
  4. artist
    Replies:
    0
    Views:
    719
    artist
    Jul 12, 2010
  5. .
    Replies:
    0
    Views:
    776
Loading...

Share This Page