I have a panel bar in a master page and I have code in my vb of the master page to set the selected link to show like so
The problem is, I have some pages you can get to by links within other pages that aren't in the panel bar. I would like to manually set the panel bar on these pages. However, I'm having trouble figuring out how I can get the control because it's in a master page. I've tried something like this
Dim clickedItem As RadPanelItem = Master.FindControl("Radmenu1")
Dim rad As RadPanelItem = clickedItem.FindItemByUrl("Leads/LeadList.aspx")
but I can't seem to figure out how to get the control to set which item. Any ideas?
Dim
clickedItem
As
RadPanelItem = RadPanelBar1.FindItemByUrl(Request.Url.PathAndQuery)
If
Not
(clickedItem
Is
Nothing
)
Then
clickedItem.ExpandParentItems()
Dim
childItem
As
RadPanelItem
For
Each
childItem
In
clickedItem.PanelBar.GetAllItems()
childItem.CssClass =
""
Next
childItem
clickedItem.CssClass =
"rpSelected"
End
If
The problem is, I have some pages you can get to by links within other pages that aren't in the panel bar. I would like to manually set the panel bar on these pages. However, I'm having trouble figuring out how I can get the control because it's in a master page. I've tried something like this
Dim clickedItem As RadPanelItem = Master.FindControl("Radmenu1")
Dim rad As RadPanelItem = clickedItem.FindItemByUrl("Leads/LeadList.aspx")
but I can't seem to figure out how to get the control to set which item. Any ideas?