Hi,
I have an ultragrid control on a windows form. It is setup to allow multiple rows to be selected and that works well. As, when CTRL is held down and the row selector clicked the row is highlighted.
However when clicking a row again it does not appear to deselect, as remains highlighted. Clicking on another row afterwards then takes the highlighting of the row that was clicked before!
I believe the row is genuinely deselected despite appearances as actions that loop through all selected do work correctly (i.e. do not include the deselected row even though it is showing as selected).
Interesting I have another grid that does behave as expected but I have not yet worked out what setting(s) might be different, any suggestions of what I might be doing wrong? The one that is working the grid is created in code but the one that is misbehaving has been drawn on the form in the designer.
All the best,
Jonathan
Hello Jonathan,
By default, when you place a new grid on a form, the designer loads a preset which will set the ActiveCellAppearance and ActiveRowAppearance, which you can change in design-time or through code. The default BackColor and ForColor properties for the Active and Selected rows are the same so this is the reason why you are seeing the active row highlighted even though it is not selected.
To overcome this, you could reset the active row appearance via the designer or with the following code:
this.ultraGrid1.DisplayLayout.Override.ActiveRowAppearance.Reset();
In case you are using a style library you could change the ResolutionOrder property of the grid to ControlThanApplication, so that changes done on the application are taking priority over the style library. To do this, open the AppStylist, select “UltraGrid”, in the properties explorer find the ResolutionOrder property and set it to ControlThanApplication.
Please let me know if you have any questions.
Regards, Ivan Kitanov
Thank you, that did fix the problem. I will try and work through and find where it was set incorrectly.
I’m glad I was able to help.
Thank you for choosing Infragistics!