Hi... I am very new to Infragistics...
Please provide a sample code for adding textboxes to the nodes of UltraTree. I don't want to replace the normal text with a textbox. The textbox is in addition to the normal checkbox nodes...
Here's some very simple sample code to get you started. Setting up the ColumnSet would be easier to do at design-time - least for the structure if not the editors. You also might want to use the OutlookExpress ViewStyle instead of grid, depending on your application. This also might easier if you create a data source and bound it to the tree instead of creating everything manually. But there's not enough information in your post for me to guess every need of your application.
private void Form1_Load(object sender, EventArgs e) { this.ultraTree1.Override.CellClickAction = CellClickAction.EditCell; this.ultraTree1.Override.LabelEdit = Infragistics.Win.DefaultableBoolean.True; this.ultraTree1.ViewStyle = Infragistics.Win.UltraWinTree.ViewStyle.Grid; UltraTreeColumnSet myColumnSet = this.ultraTree1.ColumnSettings.ColumnSets.Add("My ColumnSet"); myColumnSet.AllowCellEdit = AllowCellEdit.Full; UltraTreeNodeColumn column; column = myColumnSet.Columns.Add("CheckBox"); CheckEditor checkEditor = new CheckEditor(); checkEditor.CheckAlign = ContentAlignment.MiddleCenter; column.Editor = checkEditor; column.DataType = typeof(bool); column = myColumnSet.Columns.Add("NodeName"); column.DataType = typeof(string); column = myColumnSet.Columns.Add("TextBox"); column.DataType = typeof(string); this.ultraTree1.Override.ColumnSet = myColumnSet; for (int i = 0; i < 3; i++) { UltraTreeNode node = this.ultraTree1.Nodes.Add(); for (int j = 0; j < 3; j++) { node.Nodes.Add(); } } }
Ok. Thank you but,
My Requirement is appending textboxes to the UltraTreeView nodes like..
- [CheckBox] [Node1Name] [TextBox1]
- [CheckBox][ChildNode1Name] [TextBox2]
- [CheckBox][ChildNode2Name] [TextBox3]
- [CheckBox] [Node2Name] [TextBox4]
Please Give Me the Solution for dis asap..
You can get editing capabilities by setting the UltraTree.Override.LabelEdit property to true. This will cause a TextBox to appear in the node when the user tries to edit the node.