PanelBar FindItemBy Text

4 posts, 0 answers
  1. Renju Panicker
    Renju Panicker avatar
    23 posts
    Member since:
    Mar 2010

    Posted 30 Sep 2013 Link to this post

    Hi Team,

    Am using a RadPanelbar as a Menu structure for my website. V 2013.2.717.40

    This PanelBar is populated from a SQL Datasource and is placed in a Masterpage.

    Now when I click on the item, It will go to the corresponding page. I want the Panelbar to be expanded and the selection on the selected page.

    When I was using static Panelbar, it was working perfect.

    Once I changed it to Databinding to SQL Datasource, the FindItemByText method is returning 'Nothing'

    So I cant make the item expanded..

    Here is my masterpage code.
    <telerik:RadPanelBar ID="rdMenuBar" Runat="server" Width="200px"
                   ExpandMode="FullExpandedItem" DataFieldID="Forms_PK_ID"
                   DataValueField="Forms_PK_ID" DataFieldParentID="Forms_ParentID"
                   DataNavigateUrlField="Forms_Url" DataTextField="Forms_Name"  
    <telerik:RadPanelItemBinding Depth="0" ImageUrlField="Forms_Icon" TextField= "Forms_Name" />
    <telerik:RadPanelItemBinding Depth="1" ImageUrlField="Forms_Icon" TextField= "Forms_Name" />

    Am using the Databound event also

    Protected Sub rdMenuBar_ItemDataBound(sender As Object, e As Telerik.Web.UI.RadPanelBarEventArgs) Handles rdMenuBar.ItemDataBound
          Dim dataRow As DataRowView = DirectCast(e.Item.DataItem, DataRowView)
          e.Item.Attributes("Text") = dataRow("Forms_Name").ToString()
          e.Item.Text = e.Item.Attributes("Text")
      End Sub

    And to make the Selection expanded in the other page, am using the code as below in page_load event

    Dim rdMenuBar As RadPanelBar = Master.FindControl("rdMenuBar")
    Dim ExpandedItem As RadPanelItem = rdMenuBar.FindItemByText("Configurations")
    Dim SelectedItem As RadPanelItem = rdMenuBar.FindItemByText("Service")
    ExpandedItem.Expanded = True
    SelectedItem.Selected = True

    Can anyone help me to sort out this..

    Thanks and Regards


  2. Renju Panicker
    Renju Panicker avatar
    23 posts
    Member since:
    Mar 2010

    Posted 13 Oct 2013 Link to this post

    Hi all..

    Am i the only one who has this issue?
    Its been 2 weeks since  I posted this in the forum and no replies.. :-(

  3. Mike
    Mike avatar
    15 posts
    Member since:
    Nov 2013

    Posted 01 Mar 2014 Link to this post

    finditemby info seems to be in SHORT supply.

    it is so easy to do with MS Controls, not sure why telerik make a nice product but their tutorials etc. are often lacking.
  4. Kate
    Kate avatar
    1898 posts

    Posted 04 Mar 2014 Link to this post

    Hello Renju,

    To get more information on the different methods that you can use you can refer to the following article Please make sure also that you find the RadPanelBar control on the first place and that the items are present in the control.


    DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

Back to Top