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. nested repeater

nested repeater

Scheduled Pinned Locked Moved ASP.NET
2 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.
  • F Offline
    F Offline
    freeisgood
    wrote on last edited by
    #1

    I am working with nested repeater and i have 3 repeaters nested one under the other the one nested under the master, can be manipulated through a normal _OnItemDataBound event, but to reach the repeaters underneath the second level is not working i tried to add this: private void rptStockCategories_OnItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ((Repeater)e.Item.FindControl("rptStockCategories2")).ItemDataBound += new RepeaterItemEventHandler(rptStockCategories3_OnItemDataBound); but i think it only add the event, but wont runn it any suggestions? any

    H 1 Reply Last reply
    0
    • F freeisgood

      I am working with nested repeater and i have 3 repeaters nested one under the other the one nested under the master, can be manipulated through a normal _OnItemDataBound event, but to reach the repeaters underneath the second level is not working i tried to add this: private void rptStockCategories_OnItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ((Repeater)e.Item.FindControl("rptStockCategories2")).ItemDataBound += new RepeaterItemEventHandler(rptStockCategories3_OnItemDataBound); but i think it only add the event, but wont runn it any suggestions? any

      H Offline
      H Offline
      Harini N K
      wrote on last edited by
      #2

      Hi You need not attach event handler at run time for inner controls. You can do it design time If you are using C#, then Repeater's ItemDataBound event will be as

      protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
      {
      //Repeater 1 gets fired
      }

      Make sure that in the HTML code has 'OnItemDataBound' and set it as 'Repeater1_ItemDataBound' Now for inner repeater, copy the above code for Repeater1's event and rename it to second repeater. So second repeater event will be like this.

      protected void Repeater2_ItemDataBound(object sender, RepeaterItemEventArgs e)
      {
      //Repeater 2 gets fired
      }

      and in your HTML code will be as 'OnItemDataBound' and set it as 'Repeater1_ItemDataBound' Repeat the same for next inner repeater. So, inner controls' events automatically gets fired. :)

      Harini

      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