radtreeview issue

4 posts, 0 answers
  1. Saadettin
    Saadettin avatar
    19 posts
    Member since:
    Jan 2012

    Posted 23 Aug 2013 Link to this post

    Hi. I have a problem abot radtreeview node click event. I list categories on treeview. when I click a node, it loads related datas on the right side of screen. First, I click a node, and it loads data (also, I can make debug.). But then, when I click a node, it doesn't show new realted data, also I can't do debug on code. It runs first time. Other times, it doesn't run.

    Can someone give me an idea about how this happens?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 23 Aug 2013 Link to this post

    Hi Saadettin,

    Please try the following code snippet I tried for a similar scenario.

    ASPX:
    <div>
        <telerik:RadTreeView ID="RadTreeView1" runat="server" OnNodeClick="RadTreeView1_NodeClick">
            <Nodes>
                <telerik:RadTreeNode runat="server" Text="Item1">
                    <Nodes>
                        <telerik:RadTreeNode runat="server" Text="Item1.1">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="Item1.2">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="Item1.3">
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeNode>
                <telerik:RadTreeNode runat="server" Text="Item2">
                    <Nodes>
                        <telerik:RadTreeNode runat="server" Text="Item2.1">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="Item2.2">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="Item2.3">
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeNode>
                <telerik:RadTreeNode runat="server" Text="Item3">
                    <Nodes>
                        <telerik:RadTreeNode runat="server" Text="Item3.1">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="Item3.2">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="Item3.3">
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeNode>
            </Nodes>
        </telerik:RadTreeView>
    </div>
    <div class="listdiv">
        <telerik:RadListBox ID="RadListBox1" runat="server" Height="100px" Width="20%">
        </telerik:RadListBox>
    </div>

    C#:
    protected void RadTreeView1_NodeClick(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
    {
        RadListBox1.Items.Clear();
        foreach (RadTreeNode node2 in e.Node.GetAllNodes())
        {
            RadListBoxItem item = new RadListBoxItem();
            item.Text = node2.Text;
            RadListBox1.Items.Add(item);
     
        }
    }

    Thanks,
    Shinu.
  3. Saadettin
    Saadettin avatar
    19 posts
    Member since:
    Jan 2012

    Posted 23 Aug 2013 Link to this post

    I have a code block in aspx page.

    <telerik:AjaxSetting AjaxControlID="RadTreeAnnualReport">
            <UpdatedControls>
              <telerik:AjaxUpdatedControl ControlID="pnlContent" />
              <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" />
            </UpdatedControls>
    </telerik:AjaxSetting>

    if I remove this, it is made debug. But, when I add this , it doesn't work and make debug.
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 26 Aug 2013 Link to this post

    Hi Saadettin,

     We highly recommend to avoid working with the RadAjaxManager & RadAjaxPanel controls at the same time.
    Its difficult for me to replicate the issue with the given information. I guess you are ajaxifying the RadtreeView which is inside a RadAjaxPanel.
    Here is the sample code snippet I tried.

    ASPX:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTreeView1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
        <telerik:RadTreeView ID="RadTreeView1" runat="server" OnNodeClick="RadTreeView1_NodeClick">
            <Nodes>
                <telerik:RadTreeNode runat="server" Text="Item1">
                    <Nodes>
                        <telerik:RadTreeNode runat="server" Text="Item1.1">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="Item1.2">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="Item1.3">
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeNode>
                <telerik:RadTreeNode runat="server" Text="Item2">
                    <Nodes>
                        <telerik:RadTreeNode runat="server" Text="Item2.1">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="Item2.2">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="Item2.3">
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeNode>
                <telerik:RadTreeNode runat="server" Text="Item3">
                    <Nodes>
                        <telerik:RadTreeNode runat="server" Text="Item3.1">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="Item3.2">
                        </telerik:RadTreeNode>
                        <telerik:RadTreeNode runat="server" Text="Item3.3">
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeNode>
            </Nodes>
        </telerik:RadTreeView>
        <div class="listdiv">
            <telerik:RadListBox ID="RadListBox1" runat="server" Height="100px" Width="20%">
            </telerik:RadListBox>
        </div>
    </telerik:RadAjaxPanel>

    C#:
    protected void RadTreeView1_NodeClick(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
    {
        RadListBox1.Items.Clear();
        foreach (RadTreeNode node2 in e.Node.GetAllNodes())
        {
            RadListBoxItem item = new RadListBoxItem();
            item.Text = node2.Text;
            RadListBox1.Items.Add(item);
     
        }
    }

    Please specify why you are using two panels and provide your code if it doesn't help you.

    Thanks,
    Shinu.
Back to Top