hierarchical panel bar and load on demand

1 posts, 0 answers
  1. A K
    A K avatar
    49 posts
    Member since:
    Apr 2010

    Posted 09 Aug 2010 Link to this post

    I am binding a Panel bar to hierarchical data following way. I do get panel bar populated with hierarchy.

    .DataSource = CategoryCollection.ToList

                            .DataTextField = "Name"

                            .DataNavigateUrlField = ""

                            .DataFieldID = "Id"

                            .DataFieldParentID = "ParentId"

                            .DataBind()

    In Item click event I want to know the value of Id and parentId of clicked item. I was trying to do following way but I am getting value nothing.

    e.Item.Attributes("Id").ToString. I need to know if selected item is a parent Item or a child item. If it's child item then load user control.

    What I am trying to do is when user click on a panel item show a user control with data populated for selected panel item. I do need to pass Id and a parentId on item click to pass to this user control.

    I am trying to load user control on item click event. Is this a good approach? I don’t want to load user controls for all the panel items.

Back to Top