I'm having an issue where when a user clicks any cell of an active (and selected) row, all cells above the active row are also selected. Instead of only the chosen cell being selected.
This behavior only occurs when the active row was set without the grid having focus. I've verified if set focus on the grid as I select the row the issue goes away, but in this instance I'd prefer not to change the current focus.
From some other posts I tried playing around with something like the following:
this.Grid.DisplayLayout.Override.SelectTypeCell = SelectType.Single;
With this selection mode on cells the issue lessens, but still occurs. Instead of all cells from the top of the grid to current row being selected, only the top most row (not counting column headers) and the desired cell are selected. Using SelectType.None appears to fix the issue and give desired behavior (single cell selection) but there's concern users may not be able to select and edit a cell (so far I've not experienced this in my dev environment).
Anyone else run into this and found a better fix than changing focus? Or is it expected that with SelectTypeCell = SelectType.None that a single cell in the grid can still be selected and edited?
Thanks,
Chad
Actually no. It's very rare that any dialog would be launched by clicking on a cell, and never just by single clicking. When entering/leaving edit mode there is some validation code that might cause a message box to be displayed, but again that takes more than just a click.
In case this matters/helps the setup is a little complicated. Overall there are two different UltraWinGrid objects involved. One has a single column and is, more or less, a summary view of the main UltraWinGrid. Clicking a row (cell? doesn't matter since there's only 1 column) in the summary grid will automatically select the corresponding row in the main grid. From here the user is free to do various actions, one of which is to click a cell in the main grid of the selected row, to edit the data presented. This is where our problem crops up. No keyboard keys are being pressed, only two mouse clicks on diferent grids.
I also forgot to mention that not only do all cells from the top of grid to the selected row get highlighted, the selected row actually shifts to the top of the grid as well. The fact that the selected row changes is the specific bug reported back to us. All of the cells being highlighted/selected isn't a real problem, just a display issue.
As a snippet we have a method that gets called to select the row in the main grid:
private void ActivateRow(UltraGridRow row, bool setSelected)
{
//code to activate cell if necessary
if (setSelected)
row.Selected = true;
}
After this code executes, if the user clicks any cell in the selected row my stated issue will occur. If I add the following line of code after row.Selected then the issue goes away:
this.Grid.Focus();
However, at this time we don't want to force a change of focus in the app. The issue seems to be related to selecting a row in the grid without that grid having focus, then mouse clicking on the selected row. In the same scenario, mouse clicking a cell in a different row does not exhibit any issue. It is all specific to selecting a cell, currently activated or other, in the pre-selected row.
It's a pretty strange issue. If what I've said above doesn't make sense I can try to recreate the issue in a simple app to send your way.
I checked the DLL properties and we are using: Infragistics2.Win.UltraWinGrid.v10.2, file version: 10.2.20102.1004
Hi Chad,
Simply clicking on a cell in the grid does not select a range unless the Shift key is down, so it sounds like something is causing the grid to think that the shift key is down.
Are you doing something with the shift key? Are you using shift+some other key to launch some other dialog in the KeyDown event, or maybe showing a context menu in the MouseDown or something like that?
Or perhaps launching another dialog while the shift key is down on the grid?