Apr 12, 2011, 12:33 PM
[CLOSED] Treepanel CheckedNodes NULL when checking them from code behind.
Hi,
I use the following code to check a Treepanel node from code behind (depending on value in the database...a = b)
When saving the form again without changing the checklist (so ..do nothing with the treepanel), the following code is failing (NULL):
..but. If I check or uncheck some nodes with the mouse. This problem is not existing anymore. Above code gives me the checked nodes and I can use the value to save in the database
Any ideas ?
Martin
I use the following code to check a Treepanel node from code behind (depending on value in the database...a = b)
//Create Node
Ext.Net.TreeNode treeNode = new Ext.Net.TreeNode
{
NodeID = cNodeID,
Text = cText,
Qtip = cQtip,
Expanded = true,
Checked = (a=b) ? ThreeStateBool.True : ThreeStateBool.False
};
This works fine. The nodes are perfectly checked on screen when necessary.When saving the form again without changing the checklist (so ..do nothing with the treepanel), the following code is failing (NULL):
String[] aDebiteur = TreePanel1.CheckedNodes.Select(sn => sn.Text.Split(' ')[0]).ToArray();
// -- > use Array aDebiteur to update table in database with checked values
The CheckNodes method is NULL..but. If I check or uncheck some nodes with the mouse. This problem is not existing anymore. Above code gives me the checked nodes and I can use the value to save in the database
Any ideas ?
Martin
Last edited by Daniil; Apr 25, 2011 at 7:59 AM.
Reason: [CLOSED]