Hi,
I created a RadTree with BO and it's working perfect.
When I want to safe the eventualy change in my Database via BO I have a problem and sinds yesterday it is impossible for me to find the solution on your website.
I create the RadTree like this :
No problem. The result is perfect.
The problem is if I want to save the change.
I use the code from your website but the value of each node are empty
I don't very like this method to save the tree but this is the only way that i found.
Any idee why is always the value of the node empty.
Is in the binding the DataFieldId not the value of the nodes???
Thanks for your help.
Yves.
I created a RadTree with BO and it's working perfect.
When I want to safe the eventualy change in my Database via BO I have a problem and sinds yesterday it is impossible for me to find the solution on your website.
I create the RadTree like this :
| var categories = new Categories(); |
| List<Categories> listCategories = categories.GetAllByLanguageId(_languageId); |
| if (listCategories.Count > 0) |
| { |
| RadTreeView1.DataTextField = "Name"; |
| RadTreeView1.DataFieldID = "CategorieId"; |
| RadTreeView1.DataFieldParentID = "CategorieParentId"; |
| RadTreeView1.DataSource = listCategories; |
| RadTreeView1.DataBind(); |
| RadTreeView1.Nodes.Insert(0, MainNode); |
| // bool disabled duplicate function |
| isTreeAlreadyExist = true; |
| } |
No problem. The result is perfect.
The problem is if I want to save the change.
I use the code from your website but the value of each node are empty
| IList<RadTreeNode> allNodes = RadTreeView1.GetAllNodes(); |
| try |
| { |
| for (int i = 0; i < allNodes.Count; i++) |
| { |
| var node = (RadTreeNode) allNodes[i]; |
| if (int.Parse(node.Value) > -2) |
| { |
| int parentId = allNodes.IndexOf(node.ParentNode); |
| int categorieId = 0; |
| if (int.Parse(node.Value) > -1) |
| { |
| categorieId = int.Parse(node.Value); |
| } |
| var categorie = new Categories(categorieId); |
| categorie.Name = node.Text; |
| categorie.CultureId = cultureId; |
| if (parentId > -1) |
| { |
| categorie.CategorieParentId = parentId; |
| } |
| categorie.CategorieId = categorie.AddUpdate(); |
| } |
| } |
| } |
I don't very like this method to save the tree but this is the only way that i found.
Any idee why is always the value of the node empty.
Is in the binding the DataFieldId not the value of the nodes???
Thanks for your help.
Yves.