Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how can i bind a datalist dynamically??

how can i bind a datalist dynamically??

Scheduled Pinned Locked Moved ASP.NET
csharpquestionasp-net
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    regin
    wrote on last edited by
    #1

    :rose:im using asp.net 2.0+c# i have a datalist1 as a itemtemplate in a datalist2. in datalist2 i have an itemtemplate button if i click on that i have to bind the datalist1.hw can i do that dyanmically??:confused:

    C 1 Reply Last reply
    0
    • R regin

      :rose:im using asp.net 2.0+c# i have a datalist1 as a itemtemplate in a datalist2. in datalist2 i have an itemtemplate button if i click on that i have to bind the datalist1.hw can i do that dyanmically??:confused:

      C Offline
      C Offline
      Chetan Ranpariya
      wrote on last edited by
      #2

      Hi, Create an event handler for handling ItemCommand event of datalist as following. protected void dlst_ItemCommand ( object source, DataListCommandEventArgs e ) { //Find InnerDatalit. DataList datalist1 = ( DataList )e.Item.FindControl( "DataList1" ); //Set its datasource datalist1.DataSource = datasource. //Bind it. datalist1.DataBind(); } This event will call when u click on button in the outer datalist and will find inner datalist and bind it to the data.

      Thanks and Regards, Chetan Ranpariya

      R 1 Reply Last reply
      0
      • C Chetan Ranpariya

        Hi, Create an event handler for handling ItemCommand event of datalist as following. protected void dlst_ItemCommand ( object source, DataListCommandEventArgs e ) { //Find InnerDatalit. DataList datalist1 = ( DataList )e.Item.FindControl( "DataList1" ); //Set its datasource datalist1.DataSource = datasource. //Bind it. datalist1.DataBind(); } This event will call when u click on button in the outer datalist and will find inner datalist and bind it to the data.

        Thanks and Regards, Chetan Ranpariya

        R Offline
        R Offline
        regin
        wrote on last edited by
        #3

        Thanks its working :)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups