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

Persist node Enable/Disable across post back

6 Answers 117 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
david terek
Top achievements
Rank 1
david terek asked on 31 Jan 2009, 12:08 AM
This issue is related to another form post, but slightly different regarding maintaining state of the tree view nodes changed by client side code across post back.

I have four nodes w/Check boxes
A
B
C
D

When A is clicked, if it is checked, it will disable and uncheck every other node.  If A is unchecked it will re-enable all other nodes.
What I have found is that if I check B, and then check A, post back, I get my expected result - only A checked with all others disabled and unchecked.
Now, if I uncheck A (which re-enables everything), on the next post back all the other nodes are once again disabled.  As if the enable/disable did not persist across the post back (yet it did the first time?).

Code below (code behind is empty):

    function TVOnNodeChecked(sender, e)  
    { 
        var Tree = $find('<%=rtvTest.ClientID %>'); 
        var TreeNodes = Tree.get_allNodes(); 
        var ClickedNode = e.get_node(); 
 
        if (ClickedNode.get_value() == 1)  
        { 
            Tree.trackChanges(); 
            for (var i = 0; i < TreeNodes.length; i++)  
            { 
                var thisNode = TreeNodes[i]; 
                var thisNodeCB = thisNode.get_checkBoxElement(); 
                if (thisNode.get_value() != 1)  
                { 
                    if (ClickedNode.get_checked()) { 
                        thisNode.set_checked(false); 
                        thisNode.set_enabled(false); 
                    } 
                    else  
                    { 
                        thisNode.set_enabled(true); 
                    } 
                }             
            } 
            Tree.commitChanges(); 
        } 
    } 

<asp:Panel ID="pnl1" runat="server"
    <telerik:RadTreeView ID="rtvTest" runat="server" CheckBoxes="true" CheckChildNodes="true"  OnClientNodeChecked="TVOnNodeChecked"
        <Nodes> 
            <telerik:RadTreeNode Text="Node1" Value="1"></telerik:RadTreeNode> 
            <telerik:RadTreeNode Text="Node2" Value="2"></telerik:RadTreeNode> 
            <telerik:RadTreeNode Text="Node3" Value="3"></telerik:RadTreeNode> 
            <telerik:RadTreeNode Text="Node4a" Value="-1"
            </telerik:RadTreeNode> 
        </Nodes> 
    </telerik:RadTreeView> 
 
</asp:Panel> 
 
<br /> 
<asp:Button ID="btnPostback" runat="server" Text="Go go Postback" /> 


Telerik control version is 2008.03.1314.35

6 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 03 Feb 2009, 08:12 AM
Hello David,

We need some more time to investigate this issue. You'll be informed once we're ready. Thank you for your patience.

Best wishes,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
david terek
Top achievements
Rank 1
answered on 03 Feb 2009, 05:06 PM
I understand.  Thank you for examining this issue.
0
david terek
Top achievements
Rank 1
answered on 25 Feb 2009, 08:32 PM
Any progress on this issue?
0
Yana
Telerik team
answered on 26 Feb 2009, 07:13 AM
Hi David,

I am sorry for the delayed reply.

This seems to be a bug in RadTreeView and will be fixed. Thank you for reporting it.

Best wishes,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
david terek
Top achievements
Rank 1
answered on 29 Apr 2009, 10:36 PM
Was this issue fixed in the Q1 2009 release?
0
Yana
Telerik team
answered on 30 Apr 2009, 01:18 PM
Hi David,

I'm afraid that the problem is not solved in the Q1 2009 release, we'll address it as soon as possible, you'll be informed once it's ready. Thank you for your patience.

Best regards,
Yana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TreeView
Asked by
david terek
Top achievements
Rank 1
Answers by
Yana
Telerik team
david terek
Top achievements
Rank 1
Share this question
or