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

Disable Nodes in codebehind

3 Answers 135 Views
SiteMap
This is a migrated thread and some comments may be shown as answers.
Danny
Top achievements
Rank 2
Danny asked on 29 Mar 2013, 07:39 PM
<telerik:RadSiteMap ID="OrderRadSiteMap">
       <Nodes>
          <telerik:RadSiteMapNode Value="WeeklyOrder" ">
               <Nodes>
                   <telerik:RadSiteMapNode Value="GenerateOrders" />
  
CodeBehind:
RadSiteMap OrderSiteMap = (RadSiteMap)OrderMenuItem.FindControl("OrderRadSiteMap");

I need to disable the GenerateOrders.   The sitemap is nested into RadMenu, and I have no problem finding it- it's the nodes by value method that I haven't found any documentation on.

3 Answers, 1 is accepted

Sort by
0
Accepted
Hristo Valyavicharski
Telerik team
answered on 01 Apr 2013, 02:23 PM
Hi Danny,

"WeeklyOrder" is the parent node and "GenerateOrders" is its child. So you could find "GenerateOrders" like search in parent nodes collection using FindChildByValue:

RadSiteMapNode node = OrderRadSiteMap.Nodes[0].Nodes.FindChildByValue<RadSiteMapNode>("GenerateOrders", true);
node.Enabled = false;

Regards,
Hristo Valyavicharski
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Danny
Top achievements
Rank 2
answered on 01 Apr 2013, 02:49 PM
Thanks Hristo,
 
Yeah, I got it to work- and I had already checked that area of documentation you linked.  

I guess my main area of concern is that the documentation is a bit murky in general, and specifically the <TControlItem> parameter.   What is the significance of it in this method?

I haven't been able to find much documentation on Telerik.Web.UI.TControlItem in general, actually.
0
Hristo Valyavicharski
Telerik team
answered on 02 Apr 2013, 03:43 PM
Hi Danny,

FindChildByValue<TControlItem>(string value) is a Generic Method. It is not designated for RadSiteMap, but for all controls that have child nodes like trees, menus etc. <TControlItem> parameter should be the type of node e.g. RadSiteMapNode for RadSiteMap or RadTreeNode for RadTreeView.

Regards,
Hristo Valyavicharski
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
SiteMap
Asked by
Danny
Top achievements
Rank 2
Answers by
Hristo Valyavicharski
Telerik team
Danny
Top achievements
Rank 2
Share this question
or