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

PanelBar FindItemBy Text

3 Answers 79 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
Renju Panicker
Top achievements
Rank 1
Renju Panicker asked on 30 Sep 2013, 06:12 AM
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"
               DataSourceID="SqlDataSource1"
               DataValueField="Forms_PK_ID" DataFieldParentID="Forms_ParentID"
               DataNavigateUrlField="Forms_Url" DataTextField="Forms_Name"  
                    OnItemDataBound
="rdMenuBar_ItemDataBound">
<DataBindings>
<telerik:RadPanelItemBinding Depth="0" ImageUrlField="Forms_Icon" TextField= "Forms_Name" />
<telerik:RadPanelItemBinding Depth="1" ImageUrlField="Forms_Icon" TextField= "Forms_Name" />
</DataBindings>
</telerik:RadPanelBar>

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

Renju

3 Answers, 1 is accepted

Sort by
0
Renju Panicker
Top achievements
Rank 1
answered on 13 Oct 2013, 12:02 PM
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.. :-(

0
Mike
Top achievements
Rank 1
answered on 01 Mar 2014, 10:20 PM
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.
0
Kate
Telerik team
answered on 04 Mar 2014, 03:13 PM
Hello Renju,

To get more information on the different methods that you can use you can refer to the following article http://www.telerik.com/help/aspnet-ajax/panelbar-server-side-accessing-items.html. Please make sure also that you find the RadPanelBar control on the first place and that the items are present in the control.

Regards,
Kate
Telerik

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!

Tags
PanelBar
Asked by
Renju Panicker
Top achievements
Rank 1
Answers by
Renju Panicker
Top achievements
Rank 1
Mike
Top achievements
Rank 1
Kate
Telerik team
Share this question
or