Hello!
I need the following quite simple functionality in my ultragrid, but I have no idea how to realize it in a simple way :)
A user clicks a cell or points a cell via arrows on keyboard inside the grid. The cell just gets marked , but it's value can not be change by typing or in case of a combobox by mousewheel.
Now the user clicks exactly the same cell for a second time (but NO doubleclick) and now the cell enters the edit mode.
Thanks in advance!
At the column level set the .CellClickAction to the appropriate value.
First of all, thanks for your replies.
Our users often hit a cell with the mouse and also hit the mousewheel at the same time :) The worst case happens if they hit a combobox inside the grid and don't know which value was the right one :)
The problem is not to make the cell markable, but the problem is that I want the user to click a second time to allow him to make changes to the cell.
First click should just mark the cell.
Second click should allow the user to make changes to this cell.
Michael,
I am sending you a sample which I think gives you the functionality that you asked for. I had to handle the AfterCellActivate event and the MouseClick event off the grid and set flags to make sure that the user is clicking on the save cell that he has just activated and not another cell.
Run the application in VisualStudio 2008 and click on the cell in the "City" column in the first row which contains "Berlin". You will see that the cell does not go into edit mode. Click it again and it will go into edit mode. If you now click on another cell, for example, in the fourth row which contains "London" and then click on another one, for example, in the sixth row which contains "Mannheim", you will see that no cell is put into edit mode. If you click again on the cell which contains "Mannheim" then that cell will go into edit mode.
This logic does not take into consideration that the user might click over something that is not a grid cell. If, for example, the user clicks on a cell thereby activating the cell and then clicks on a column header the cell he had previously clicked will go into edit mode which, presumably you don't want. So you will have to refine this logic to check that the user really is clicking over a grid cell.
Let me know if you would like me to help you with that.
I hope this helps.
Michael S.
That's exactly the behavior I need. I've created some functions to check whether a header or filter row cell is clicked or not. I hoped about a solution without these booleans, but this is fine,too.
Thank you Michael for your code.
I'm glad that code worked for you. Let me know if there is anything else I can help you with.