Vb-Net How to bind a datalist?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jeenajos
    New Member
    • Oct 2007
    • 71

    Vb-Net How to bind a datalist?

    Hi all,

    Tel me a coding to bind the datalist.Is it same as that of gridview?
    PLS Help.

    Thanks
    Jeen
  • aliasruel
    New Member
    • Sep 2007
    • 73

    #2
    HI...

    To bind a datalist is same as binding a datasource in datagrid....

    Me.DataList1.Da taSource = contDs
    Me.DataList1.Da taBind()

    First, you have to edit the template by right clicking the dataitem control..
    select the Item Templates and add a label control (for example)
    select the label control and open its property.. go to databindings
    select the custom binding expression.
    there you type the code below and click ok:

    DataBinder.Eval (Container.Data Item,"Name")
    assuming one of your the fields in you table1 is "Name"

    ok regards,
    Ruel




    =============== =============== =============== ==========

    Originally posted by jeenajos
    Hi all,

    Tel me a coding to bind the datalist.Is it same as that of gridview?
    PLS Help.

    Thanks
    Jeen

    Comment

    • jeenajos
      New Member
      • Oct 2007
      • 71

      #3
      Originally posted by aliasruel
      HI...

      To bind a datalist is same as binding a datasource in datagrid....

      Me.DataList1.Da taSource = contDs
      Me.DataList1.Da taBind()

      First, you have to edit the template by right clicking the dataitem control..
      select the Item Templates and add a label control (for example)
      select the label control and open its property.. go to databindings
      select the custom binding expression.
      there you type the code below and click ok:

      DataBinder.Eval (Container.Data Item,"Name")
      assuming one of your the fields in you table1 is "Name"

      ok regards,
      Ruel




      =============== =============== =============== ==========
      Thank U Ruel for ur solution.

      Jeen

      Comment

      Working...