Hello,
I'm loading a tree from my database inside of Page Load with the following code:
Based on the node_type value, I want to change the node in the tree.
The possible special node types are:
List (drop down list)
Header (uneditable)
Number (textfield)
String (textfield)
Password (passwordfield)
Boolean (checkbox)
How do I change the type of node that this is in the tree? I tried to figure out how to add a custom template here but couldn't figure it out.
Thanks
I'm loading a tree from my database inside of Page Load with the following code:
| if (!Page.IsPostBack) { |
| string query = "SELECT id, node_name, node_type,"+ |
| " default_value, attributes, parent_id FROM default_tree"; |
| dataSource = MyMasterPage.executeSQLQuery(query); |
| Hashtable hash = new Hashtable(); |
| foreach (DataRow dr in dataSource.Rows) { |
| int id = Convert.ToInt32(dr["id"]); |
| string node_name = dr["node_name"].ToString(); |
| string node_type = dr["node_type"].ToString(); |
| string value = dr["default_value"].ToString(); |
| string attributes = dr["attributes"].ToString(); |
| int parent_id = Convert.ToInt32(dr["parent_id"]); |
| RadTreeNode node = new RadTreeNode(node_name); |
| |
| //here I want to be able to customize the node |
| node.Value = parent_id + ';' + node_type + ';' + value + ';' + attributes; |
| hash.Add(id, node); |
| if (parent_id == 0) { |
| optionsTree.Nodes.Add(node); |
| } else { |
| RadTreeNode parent = (RadTreeNode)hash[parent_id]; |
| parent.Nodes.Add(node); |
| } |
| } |
| } |
Based on the node_type value, I want to change the node in the tree.
The possible special node types are:
List (drop down list)
Header (uneditable)
Number (textfield)
String (textfield)
Password (passwordfield)
Boolean (checkbox)
How do I change the type of node that this is in the tree? I tried to figure out how to add a custom template here but couldn't figure it out.
Thanks