I'm trying to allow the user of an ultragrid to be able to deselect a grid row by just clicking on an existing selected row. I have the following relevant settings on my grid:
this.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect; AND
this.mGrid.DisplayLayout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.Single;
I've tried to hook into the CellClick event to do this, but I've found it difficult to only have that event fire when a grid row is currently selected (and preferably I would think that the developer consuming the ultragrid wouldn't have to narrow down any logic via the interaction between the AfterSelectChanged and CellClick event in order to make this work).
Hi,
There's no property for this.
A user can de-select a row by CTRL+Clicking on a selected row. This is standard behavior in Windows.
As for trapping an event, I don't see any way to do this. The problem is that the row is selected before the MouseDown event fires. So checking whether the row is selected inside any event like Click, CellClick, or MouseDown will always return true and you won't be able to detect if the row was already selected or if it's being selected. At least not without jumping through some hoops like deriving your own grid control and then overriding OnMouseDown so you can check the selected state of the row before the event fires.
In my grid, it seems that ctrl + click doesn't seem to be doing the job. Is there any property that would be adversely affecting this behavior? Perhaps this.mGrid.DisplayLayout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.Single? I'd like to have that property selected because I want to enforce one row max selection