Hi
I have a grid where i wish to use the '-' key to toggel between two cells.
When i press the '-' key, i tell the cell which i am moving to, to have the same value as the previous cell. So cell 1 has the value 500, I press the '-' key and I want cell 2 to have the value of 500 also.
After i set the cells value, i then want to enter edit mode in the cell. I can do this but as soon as i enter edit mode the cells appearance shows the cell as blank.
Is there anyway that i can enter the cells edit mode without it clearing the display contents? (Interestingly enough i have a row in the grid which looks at the totals and it knows that the cell has the value 500 but you just cant see it, when you exit edit mode for that cells the value appears)
grid.ActiveCell = debitCell;
debitCell.Value = creditValue;
grid.PerformAction(
UltraGridAction.EnterEditMode);
grid.ActiveCell.SelStart = 0;
Not sure what happend to the presentation there
debitcell.Value = creditValue;
grid.PerformAction(UltraGridAction.EnterEditMode);
What event are you using to trap for the '-' key? If you are using KeyDown, perhaps the KeyUp is getting triggered after you have entered edit mode and thus clearing the text in the cell.
Also, if you check the Value of the cell after it enters edit mode, is it correct? Or is it null? To test this, I would use a Click Event of some control that doesn't take focus, like a label. That way you can be sure you are testing it after the cell has already entered edit mode without taking it out of edit mode.