This is a migrated thread and some comments may be shown as answers.

hierarchical panel bar and load on demand

0 Answers 29 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
A K
Top achievements
Rank 1
A K asked on 09 Aug 2010, 06:47 PM

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.

No answers yet. Maybe you can help?

Tags
PanelBar
Asked by
A K
Top achievements
Rank 1
Share this question
or