Hi There,
I have ultraWinGrid, in which I need to enable the multiple row selection. With the following code in the MouseUp event, its working fine:
UltraGrid
;
// Get the row that was clicked on, if any.
(e.X, e.Y));
)
{
// Clear any cell or column selection.
grid.Selected.Cells.Clear();
grid.Selected.Columns.Clear();
// Toggle the selection of the row.
row.Selected = !row.Selected;
}
But the problem is, I want to raise the MouseUp event only if I click the row with Ctrl or Shift key pressed. Is there any property to set for using the ctrl or shift keys?
Thanks in Advance,
Santosh
Hi Santosh,
I don't understand what you are trying to do here. The grid already has built-in support for selecting multiple rows. In fact, this is the default behavior.
You don't need to do anything in the MouseUp event.
grdTransactions.DisplayLayout.Override.SelectTypeCell = SelectType.None;
grdTransactions.DisplayLayout.Override.SelectTypeRow = SelectType.Extended;
grdTransactions.DisplayLayout.Bands[0].Override.SelectTypeCell = SelectType.None;
grdTransactions.DisplayLayout.Bands[0].Override.SelectTypeRow = SelectType.Extended;
using this code, the Cell selection can be disabled. But row selection was not enabled.
I'm afraid I still don't understand what you are trying to do or what the problem is.
When the user clicks on a cell, what happens is determined by the CellClickAction property. So you will have to decide whether you want the cell click to select the row or select the cell, or enter edit mode.