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

RadPanelbar Parent item properties

1 Answer 99 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
usr9999
Top achievements
Rank 1
usr9999 asked on 30 Jun 2011, 06:41 PM
Hi,

I am using RadPanelbar as menu item in my app. The PanelBar is getting created dynamically from the database. I would like to differentiate parent and child menu items. The following is what I would like to do. Please let me how I can get this functionality.

1)    User should not be able to click on the Parent item.
2)    Add 2 different icons to Parent and Child menu items.

The following is my code.


Public Sub BindPanelBar(ByVal ds As DataSet)
        RadPanelBar1.DataTextField = "description"
        RadPanelBar1.DataNavigateUrlField = ""
        RadPanelBar1.DataFieldID = "id"
        RadPanelBar1.DataFieldParentID = "PARENT_ID"
        RadPanelBar1.DataValueField = "Code"
        RadPanelBar1.DataSource = ds
        RadPanelBar1.DataBind()

End Sub

Protected Sub RadPanelBar1_ItemDataBound(ByVal sender As Object, ByVal e As RadPanelBarEventArgs) Handles RadPanelBar1.ItemDataBound
        Dim row As DataRowView = DirectCast(e.Item.DataItem, DataRowView)
        e.Item.Enabled = [Boolean].Parse(row("enable_status").ToString())
        e.Item.Expanded = True
        e.Item.ToolTip = e.Item.Text
 
End Sub


Thank you,

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 05 Jul 2011, 03:13 PM
Hello Usr9999,

What you have shown as a code snippet should disable the panelbar items which have "enable_status" false. I presume that the items that have "enable_status" false are the parent items so you should be able to disable them with this code. If you want to distinguish the parent items from the children then you should again check the "enable_status" property and assign the appropriate image to the particular item

Could you clarify what is the problem that you are experiencing with the current implementation of your ItemDataBound event handler function?

Greetings,
Dimitar Terziev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
PanelBar
Asked by
usr9999
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or