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

radtreeview issue

3 Answers 27 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Saadettin
Top achievements
Rank 1
Saadettin asked on 23 Aug 2013, 07:38 AM
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?

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 23 Aug 2013, 10:26 AM
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.
0
Saadettin
Top achievements
Rank 1
answered on 23 Aug 2013, 10:37 AM
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.
0
Shinu
Top achievements
Rank 1
answered on 26 Aug 2013, 07:58 AM
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.
Tags
General Discussions
Asked by
Saadettin
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Saadettin
Top achievements
Rank 1
Share this question
or