Hello
The following code is supposed to place an editor control of type UltraNumericEditor on the single node that it has. However, it does not work.
Can you please tell what is wrong?
Thanks a lot.
With Me.UltraTree1 .ViewStyle = Infragistics.Win.UltraWinTree.ViewStyle.OutlookExpress With .ColumnSettings .RootColumnSet.Columns.Add("TestColumn") .AutoFitColumns = Infragistics.Win.UltraWinTree.AutoFitColumns.ResizeAllColumns End With With .Override .ShowEditorButtons = Infragistics.Win.UltraWinTree.ShowEditorButtons.Always .EditorControl = UltraNumericEditor1 End With With .Nodes .Add("FirstNode") End With End With
When running under the OutlookExpress view style, you must assign the editor provider to the EditorControl property of the column in which you want the editor to display.
Example:
Thanks. I tried but this exception is raised: "The Owner specified a type to EditorWithMask that is not supported by the editor."
By the way, the code of my previous post implies that a new Tree control is placed on the form with no modifications, and that a NumericEditor is also placed (styled with an Office 2007 look). You can see in the code that a single column and a single node is added.
Any ideas?
I am still having problems setting the editor. Please, allow me to explain what I intend to do: - I want to configure the Tree with 2 columns ("Property" and "Value") - Only cells of the second column can be edited - Each cell can have a different kind of editor So far, I cannot get the tree to have editable cells.
You should probably take a look at the 'UltraTree PropertyGrid' sample that ships with the product; the sample was written before the ability to edit cells was added, but to enable cell editing you can set the ColumnSettings.AllowCellEdit property (you might also want to set Override.CellClickAction if you want cells to enter edit mode on a MouseDown).
Regarding the exception you were getting when embedding the UltraNumericEditor: that control only supports the Integer and Double data types, so you can't embed that editor in a column of some other data type.
Thanks, I got it working with the following code.
By the way, how can I set an editor for a given cell? (that is, not for the entire column or the whole row).
I placed a new tree control on the form. In the form Load() event I wrote the following code:
Dim objFirstColumn As Infragistics.Win.UltraWinTree.UltraTreeNodeColumn Dim objSecondColumn As Infragistics.Win.UltraWinTree.UltraTreeNodeColumn
UltraTree1.ViewStyle = Infragistics.Win.UltraWinTree.ViewStyle.OutlookExpress UltraTree1.Override.UseEditor = Infragistics.Win.DefaultableBoolean.True UltraTree1.Override.LabelEdit = Infragistics.Win.DefaultableBoolean.True UltraTree1.Override.CellClickAction = Infragistics.Win.UltraWinTree.CellClickAction.EditCell
objFirstColumn = UltraTree1.ColumnSettings.RootColumnSet.Columns.Add("Col1") objSecondColumn = UltraTree1.ColumnSettings.RootColumnSet.Columns.Add("Col2")
UltraTree1.Nodes.Add("TestNode") UltraTree1.Nodes(0).SetCellValue(objFirstColumn, "Value11") UltraTree1.Nodes(0).SetCellValue(objSecondColumn, "Value12")
objSecondColumn.AllowCellEdit = Infragistics.Win.UltraWinTree.AllowCellEdit.Full
objSecondColumn.Editor = New Infragistics.Win.EditorWithText()