Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
907
Anyone have a workign example of a numeric editor working in a tree control?
posted

I can get it to display numbers, but when I try to change a value of 0 to 1, I get the followign error: 'Unable to update the data value: The editor's current value is not valid."  I also can't get the spin button to appear...

 

Below are the editor declaration and configuration that are used by the cells

//

// Used as the editor to add to cells that need a checkbox or numeric editor.

// We have to add a static instance to each cell, rather than the column if we

// want to only have the editors in some cells and not all cells in the column

//

private UltraCheckEditor ultraCheckEditor = new UltraCheckEditor();

private UltraNumericEditor ultraNumericEditor = new UltraNumericEditor();

public FieldListControl() {

InitializeComponent();

//

// Set some default behaviors for the numeric editor we'll use in our cells.

//

ultraNumericEditor.NumericType = NumericType.Integer;

ultraNumericEditor.PromptChar = ' ';

ultraNumericEditor.SpinButtonDisplayStyle = ButtonDisplayStyle.OnMouseEnter;

}

 

Here is how I try to use the editors

 

//

// Setup the override editors

//

node.Cells["Override Min Length"].AllowEdit = AllowCellEdit.Full;

node.Cells["Override Max Length"].AllowEdit = AllowCellEdit.Full;

node.Cells["Override Min Length"].EditorControl = ultraNumericEditor;

node.Cells["Override Max Length"].EditorControl = ultraNumericEditor;

//

// Get our numeric control for editing overrides

//

UltraNumericEditor minLenIntCtrl = node.Cells["Override Min Length"].EditorControl as UltraNumericEditor;

UltraNumericEditor maxLenIntCtrl = node.Cells["Override Max Length"].EditorControl as UltraNumericEditor;

if (minLenIntCtrl != null && maxLenIntCtrl != null) {

//

// Configure our numeric controls

//

minLenIntCtrl.MinValue = field.MinLength;

minLenIntCtrl.MaxValue = overrideField.MaxLength;

minLenIntCtrl.Value = overrideField.MinLength;

node.Cells[
"Override Min Length"].Value = overrideField.MinLength;

maxLenIntCtrl.MinValue = overrideField.MinLength;

maxLenIntCtrl.MaxValue = field.MaxLength;

maxLenIntCtrl.Value = overrideField.MaxLength;

node.Cells[
"Override Max Length"].Value = overrideField.MaxLength;

}

 

 

In my test case on a min length override value.   MinValue = 0, MaxValue = 10 wit ha Value of 0

I can type in anything I want, I tried 1,5,9,10 and 23 and all get the same error.

I've been experiment with various properties, including numeric type to no avail.

 

I also have the CellValueChanged event configured and the cell value never changes, nor does the editor...

Looking for new idea to try here...