Hi,
I'm using an UltraWinGrid (version 11.1.20111.1003).
When right clicking on a row selector, the previous selected line is kept, which is not what I expect (previous selected row should be unselected). How can I disable this behavior?
Hello tfresnea,
If you would like to have just a single row selected, than I suggest you to set the SelectTypeRow of the Override object to Single in the InitializeLayout event of the UltraGrid like:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.Single; }
Please let us know if you have any other questions with this matter.
Hi Danko,
I'd like to allow the user to select multiple rows when he presses Ctrl or Shift. But I don't want that right click on the row selector keeps the previous selection. Thus, unfortunately, your solution will not be satisfactory to me.
Hello Tfresnea,
There is another way to achieve that. You could use MouseEnterElement and MouseLeaveElement for example to verify if you are clicking over a row selector or not. One possible code snippet to do so is shown below:
bool isRowSelector = false; private void ultraGrid1_Click(object sender, EventArgs e) { if (isRowSelector) { //Do what you have to do here } } private void ultraGrid1_MouseEnterElement(object sender, Infragistics.Win.UIElementEventArgs e) { if (e.Element is RowSelectorUIElement) { isRowSelector = true; } } private void ultraGrid1_MouseLeaveElement(object sender, Infragistics.Win.UIElementEventArgs e) { if (isRowSelector) { isRowSelector = false; } }
Please feel free to let me know if there is anything else that I could assist you with.
I tried your solution and it works. I'm clearing the selected rows in the MouseDown event handler in case I'm right clicking a row selector.
Thanks.
Hello Tfresna,
Thank you for the feedback.
If you have any questions in the future please feel free to contact us.
I do have same problem, when I rightclick to rowselector, it is pointing me to old row, but I need right click feature on row selector too, how can I get current active row on right click of row selector.
Hi Rubie,
I don't know what you mean by "it is pointing me to old row". What property are you accessing?