3 Answers, 1 is accepted
0
Hi rene,
I could not reproduce the problem with our online example on CheckBox Support. If you check a parent node on the right, a postback appear and the expanded state will be persisted after the postback.
What is different in your case?
Kind regards,
Nick
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I could not reproduce the problem with our online example on CheckBox Support. If you check a parent node on the right, a postback appear and the expanded state will be persisted after the postback.
What is different in your case?
Kind regards,
Nick
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
rene
Top achievements
Rank 1
answered on 09 May 2008, 02:43 PM
Hello Nick, thank you for your reply. Its a bit more complicated, I'll explain.
I am doing a custom control (Composite Control). One of the controls that I display in my custom control is a RadTreeView. The code is as follows:
namespace Altep.Web.Controls
{
public class WebTree : CompositeControl, ITreeControl
{
protected RadTreeView _treeView;
public WebTree()
{
_treeView = new RadTreeView();
}
....
protected override void CreateChildControls()
{
_treeView.ID = TreeID + "_" + this.ID;
_treeView.CheckBoxes = true;
_treeView.AutoPostBackOnCheck = true;
_treeView.AfterClientCheck = "jsAfterCheck";
_treeView.NodeCheck += new RadTreeView.RadTreeViewEventHandler(NodeCheckEventHandler);
LoadTree(MyDataSource);
Controls.Add(_treeView);
base.CreateChildControls();
}
....
protected void NodeCheckEventHandler(object o, RadTreeNodeEventArgs e)
{
//get all checked nodes from tree
ArrayList checkedNodeCollection = _treeView.CheckedNodes;
foreach(RadTreeNode checkedNode in checkedNodeCollection)
{
//synch with my model
}
}
...
}
}
On my javascript side, I have the following
function CheckAllChildren(nodes, checked)
{
for(var i = 0; i < nodes.length; ++i){
if(checked) nodes[i].Check();
else nodes[i].UnCheck();
if(nodes[i].Nodes.length > 0)
CheckAllChildren(nodes[i].Nodes, checked);
}
return;
}
function jsAfterCheck(node)
{
CheckAllChildren(node.Nodes, node.Checked);
return;
}
I have the problem of when the node is checked, I get the post back to my NodeCheckEventHandler method, but after exiting, the checked node collapses.
Second problem, the line
ArrayList checkedNodeCollection = _treeView.CheckedNodes;
returns one, even though in my GUI I have the parent and all of its children cheked.
BTW, when AutoPostBackOnCheck = false;
The checked node does not collapse.
Am I missing something? Does rendering the control this way changes things?
Please help
I am doing a custom control (Composite Control). One of the controls that I display in my custom control is a RadTreeView. The code is as follows:
namespace Altep.Web.Controls
{
public class WebTree : CompositeControl, ITreeControl
{
protected RadTreeView _treeView;
public WebTree()
{
_treeView = new RadTreeView();
}
....
protected override void CreateChildControls()
{
_treeView.ID = TreeID + "_" + this.ID;
_treeView.CheckBoxes = true;
_treeView.AutoPostBackOnCheck = true;
_treeView.AfterClientCheck = "jsAfterCheck";
_treeView.NodeCheck += new RadTreeView.RadTreeViewEventHandler(NodeCheckEventHandler);
LoadTree(MyDataSource);
Controls.Add(_treeView);
base.CreateChildControls();
}
....
protected void NodeCheckEventHandler(object o, RadTreeNodeEventArgs e)
{
//get all checked nodes from tree
ArrayList checkedNodeCollection = _treeView.CheckedNodes;
foreach(RadTreeNode checkedNode in checkedNodeCollection)
{
//synch with my model
}
}
...
}
}
On my javascript side, I have the following
function CheckAllChildren(nodes, checked)
{
for(var i = 0; i < nodes.length; ++i){
if(checked) nodes[i].Check();
else nodes[i].UnCheck();
if(nodes[i].Nodes.length > 0)
CheckAllChildren(nodes[i].Nodes, checked);
}
return;
}
function jsAfterCheck(node)
{
CheckAllChildren(node.Nodes, node.Checked);
return;
}
I have the problem of when the node is checked, I get the post back to my NodeCheckEventHandler method, but after exiting, the checked node collapses.
Second problem, the line
ArrayList checkedNodeCollection = _treeView.CheckedNodes;
returns one, even though in my GUI I have the parent and all of its children cheked.
BTW, when AutoPostBackOnCheck = false;
The checked node does not collapse.
Am I missing something? Does rendering the control this way changes things?
Please help
0
Hello rene,
I am afraid that there is not much I can say without first seeing your project files. Can you put together a small and running project and attach the files to a new support thread? We will test them locally and try to find a working solution for you.
Expecting your reply,
Nick
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I am afraid that there is not much I can say without first seeing your project files. Can you put together a small and running project and attach the files to a new support thread? We will test them locally and try to find a working solution for you.
Expecting your reply,
Nick
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
