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
390
Help using ButtonsLeft of UltraNumericEditor in Grid
posted

Hi,

I have a UltraWinGrid where with a numeric column that is toggable on/off.  I have created an UltraNumericEditor and added the ultraNumericEditor to the form.  I assigned the EditorControl property of the column to the UltraNumericEditor.  The UltraNumericEditor has been configured with a StateEditorButton in the ButtonsLeft collection (to toggle on/off) and a SpinEditorButton in the ButtonsRight collection (to increment/decrement by a custom amount).

I would like the cells in this column to display the numeric value and the checkbox in the grid.

 My problem is that when I check the StateEditorButton of one cell, all of the cells in the column receive the new CheckState.  I have tried using the InitializeCheckState event of the UltraNumericEditor, but I have not been able to make it work correctly.  It seems as though the Editor/EditorControl remembers the state of the last active cell (???).

 I have also tried creating a different UltraNumericEditor for the specific cell in each row of the grid.  When I do this, I get an exception if the up/down spin button is held down that the cell is not in edit mode.

 Any thoughts/help would be greatly appreciated.  Has anyone been able to get a check box and numeric editor working for cells of a column in the grid?

 Thanks in advance!

Parents
No Data
Reply
  • 37774
    posted

    As it seems you have guessed, having a single editor for an entire column means that each cell will be using the same editor when it goes into edit mode, so having the editor maintain a single state will not work in this case.  If you want to reuse the editor, you will need to maintain the list of what's checked or not somehow, either in the Tag property of a cell or some other data structure.

    As for getting an exception when clicking the spin button, I'm not sure what the problem here is without seeing the exception, since the added spin button does not do anything by default.  You could certainly try forcing the cell into edit mode yourself, such as "this.ultraGrid1.PerformAction(UltraGridAction.EnterEditMode);", and check to see if it was successful by either the return value or by checking to see if the ActiveCell is in edit mode.

    -Matt

Children