| |
| //Class to specify node template as per node |
| |
| public class multipleColumnTreeViewNode : ITemplate |
| { |
| public void InstantiateIn(Control container) |
| { |
| Label space = new Label(); |
| space.Text = ((RadTreeNode)container).Text + " "; |
| space.ID = "lbSpace"; |
| space.Attributes.Add("runat", "server"); |
| container.Controls.Add(space); |
| |
| CheckBox cbCanEdit = new CheckBox(); |
| cbCanEdit.ID = "cbCanEdit"; |
| cbCanEdit.Attributes.Add("runat", "server"); |
| cbCanEdit.AutoPostBack = true; |
| cbCanEdit.CheckedChanged += new EventHandler(cbCanEdit_CheckedChanged); |
| cbCanEdit.Text = "can edit"; |
| cbCanEdit.ForeColor = System.Drawing.Color.PaleGoldenrod; |
| cbCanEdit.TextAlign = TextAlign.Left; |
| container.Controls.Add(cbCanEdit); |
| } |
| |
| private void cbCanEdit_CheckedChanged(object sender, EventArgs e) |
| { |
| //Code here |
| } |
| |
| |
| //Adding actionCategory and user actions nodes to sitemap treeview nodes |
| if (dtActionCategory.Rows.Count != 0 && datTable.Rows.Count != 0) |
| { |
| var actionCats = from actionCatsData in dbcontext.userActionCategories |
| where actionCatsData.actionCategoryID == int.Parse(datRow["actionCategoryID"].ToString()) |
| select new { actionCatsData.actionCategoryID, actionCatsData.name }; |
| |
| if (actionCats.Count() != 0) |
| { |
| foreach (var tempData in actionCats) |
| { |
| RadTreeNode actionCatNode = new RadTreeNode(tempData.name); |
| actionCatNode.ToolTip = "ActionCategory - Tick to make all the actions under this category active for the role"; |
| actionCatNode.Value = "ActionCategory:" + tempData.actionCategoryID.ToString(); |
| actionCatNode.ForeColor = System.Drawing.Color.Yellow; |
| treeNode.Nodes.Add(actionCatNode); |
| |
| var actions = from actionData in dbcontext.userActions |
| where actionData.actionCategoryID == int.Parse(datRow["actionCategoryID"].ToString()) |
| select new { actionData.actionID, actionData.description }; |
| |
| if (actions.Count() != 0) |
| { |
| foreach (var data in actions) |
| { |
| RadTreeNode actionNode = new RadTreeNode(data.description); |
| actionNode.Text = data.description; |
| actionNode.NodeTemplate = new multipleColumnTreeViewNode(); |
| actionNode.ToolTip = "Action - Tick to make this sitemap action active for the role"; |
| actionNode.Value = "Action:" + data.actionID.ToString(); |
| actionNode.ForeColor = System.Drawing.Color.PaleGoldenrod; |
| actionCatNode.Nodes.Add(actionNode); |
| } |
| } |
| } |
| } |
| } |
| //Adding the node to the treeview with all the child nodes |
| nodes.Add(treeNode); |
| } |