Hi,
How could I implement a control like the NumericUpDown to embed it in a column ?? Where I cand find information about that?
I'd like use it for deal with UltraGridColumn and percentages.
Thanks in advance.
The easiest way to get a spin button in a grid cell is to use an existing editor control like UltraNumericEditor. Just put an UltraNumericEditor control on the form with the grid.From there you have a couple of options.
1) Set SpinButtonDisplayStyle on the UltraNumericEditor. This will give you a built-in spin button which spins the value based on the mask. You can then set other properties like SpinButtonAlignment, SpinWra, and SpinIncrement.
2) Use the ButtonsRight or ButtonsLeft collection to add a SpinEditorButton and handle the EditorSpinButtonClick event and change the value of the cell yourself.
Either way, you attach the control to the grid column via the EditorControl property.
I am attaching UltraNumericEditor to the grid column using EditorControl property it works fine, i have attached ValueChanged event which is not getting fired when i click on the spin button, but the same thing is working when i placed UltraNumericEditor control on the form ,
where am i doing wrong?
could you please help me on this?
UltraNumericEditor numericEditor = new UltraNumericEditor( );
numericEditor.Nullable = false,
numericEditor. MinValue = 0 ;
You cannot rely on the events of the EditorControl to fire when they are used as the editor in the grid. The control simply provides a clone of the editor that the grid should use along with many default properties, but from that point the grid is generally responsible for handling all events and input.
-Matt
So you need to use the CellChange event of the grid, rather than the ValueChanged of the NumericEditor control.