RadTreeView inside RadComboBox

2 posts, 0 answers
  1. Vitaly
    Vitaly  avatar
    68 posts
    Member since:
    Aug 2011

    Posted 19 Nov 2013 Link to this post

    Hi,
    the following code is in my aspx page:
     <telerik:RadComboBox ID="RadComboBoxStatusGrp" runat="server" Width="125px"
                 Height="150px" Font-Size="Small" CssClass="txtinput" AutoPostBack="false"
                 EmptyMessage="Choose a Status" ShowToggleImage="true"
                  OnClientDropDownOpened="OnClientDropDownOpenedHandler">

                 
          <ItemTemplate>
           <div id="div1">
           <telerik:RadTreeView runat="server" ID="RadTreeView1" OnClientNodeClicking="nodeClicking">
            <Nodes>
              <telerik:RadTreeNode runat="server" Text="TR" Expanded="true" >
               <Nodes>
                <telerik:RadTreeNode runat="server" Text="Approved"  >
                </telerik:RadTreeNode>
                 <telerik:RadTreeNode runat="server" Text="Entered"  >
                 </telerik:RadTreeNode>
                 <telerik:RadTreeNode runat="server" Text="All Trans" >
                 </telerik:RadTreeNode>
                
                </Nodes>
                </telerik:RadTreeNode>
                </Nodes>  
                <Nodes>
                 <telerik:RadTreeNode runat="server" Text="Processed"  Expanded="true"></telerik:RadTreeNode>
                </Nodes>
                <Nodes>
                 <telerik:RadTreeNode runat="server" Text="All" Expanded="true"></telerik:RadTreeNode>
                </Nodes>  
           </telerik:RadTreeView>
           </div>
          </ItemTemplate>
          <Items>
            <telerik:RadComboBoxItem Text="" />
          </Items>
         </telerik:RadComboBox>
          <script type="text/javascript">
              var div1 = document.getElementById("div1");
              div1.onclick = StopPropagation;
         
       </script>

    In C# on page_load event I am reading SP and get field call RunFlag.
    If RunFlag == "I"
     disable "Processed" node.
    How can I do that?

    Thanks so much for your help
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 20 Nov 2013 Link to this post

    Hi Vitaly,

    You can easily find the RadTreeVIew control in the RadComboBox by using the following code
    var treeviewInCombo= RadComboBox2.Items[0].FindControl("RadTreeView1");

    After you get reference to the needed control you can set the desired node as per your requirements. Here is a help article that you can refer that can provide you more information and sample how to find the node.

    Regards,
    Kate
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top