I have a grid with the CellClickAction set to RowSelect mode, and I am capturing the Cell Double-Click event.
What I would like to do in that double-click event is put that cell only into edit mode, then exit the edit mode as soon as that cell loses focus. Is this possible?
I was hoping for a "CellDoubleClickAction" that could be set to EnterEditMode or something. I don't want to enter edit mode on a cell when I single click. And would prefer to only enter edit mode on select cells, not any cell on the row.
I'm not even sure how to enter edit mode on a cell from the double-click event. I tried doing a PerformAction on the grid in the double-click even handler, but neither the cell nor the grid entered edit mode.
That's easy enough to solve. Just keep a flag that stores the last mouse button that was used in the MouseDown or MouseClick event.
DoubleClickCell do not tell which mose button was pressed so it is not working properly if i want Double click only from LeftButton!!!
Ok This works. And I have added a routine to capture keypress so that when 'enter' is pressed, the grid exits edit mode. So now, if I press enter, or change to a different cell (with mouse click), edit mode is off. Just the way I want it. Thanks.
Developers: In the future, it might be nice to combine this kind of thing as a new CellClickAction like "EditOnCellDoubleClick"
The easiest way to do this would be to handle the DoubleClickCell event of the grid, activate the cell, then put it into edit mode:
private void ultraGrid1_DoubleClickCell(object sender, Infragistics.Win.UltraWinGrid.DoubleClickCellEventArgs e){ e.Cell.Activate(); this.ultraGrid1.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.EnterEditMode);}
-Matt