RadPanelbar Parent item properties

2 posts, 0 answers
  1. usr9999
    usr9999 avatar
    41 posts
    Member since:
    Jun 2010

    Posted 30 Jun 2011 Link to this post


    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

    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,
  2. Dimitar Terziev
    Dimitar Terziev avatar
    1266 posts

    Posted 05 Jul 2011 Link to this post

    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?

    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!

Back to Top