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).
Hello,
I am checking about the progress of this issue. Please let me know If you need any further assistance on this.
Try this:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.Override.MaxSelectedRows = 1; }
Please take a look at the sample attached to this post and try with it. I have also included a video in the archive.
I tried calling the Reset methods on the ActiveCellAppearance and ActiveRowAppearance, but no luck. I did however find out that if I didn't set SelectType.Single for the SelectTypeRow that I got the behavior I wanted...but without the ability to restrict the user to selecting one row. Unless I'm missing something, it looks like there might not be a way to unselect if that property is specified.
My guess is that the row is being de-selected, but it still appears selected because it's the ActiveRow.
FAQ:How do I turn off the ActiveRowAppearance so that the active row in the grid does not appear selected.