Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
361
disabling "drag selection" for selecting multiple rows in UltraWinGrid
posted

I have an UltraWinGrid, where I want multiple cell selection to be possible in only one way : iff the user holds down the CTRL/SHIFT key and selects by clicking the cells.

I do not want users to be able to drag over a region to select multiple cells.  How can this be accomplished? I am currently using v7.3. Thanks.

Parents
  • 1210
    Offline posted

    Something along this line might work for you (the code is in vb):

    In InitializeLayout:

    e.Layout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.RowSelect

    e.Layout.Override.SelectTypeCell = Infragistics.Win.UltraWinGrid.SelectType.Extended

    e.Layout.Override.SelectTypeCol = Infragistics.Win.UltraWinGrid.SelectType.None

    e.Layout.Override.SelectTypeRow = Infragistics.Win.UltraWinGrid.SelectType.None

    The code above will cause nothing to be selected when the user clicks on a cell or column. The cell's row is activated on click, but no selection takes place. This will also allow for multiply cell selection in code (see below).

    In UltraGrid_ClickCell

     

     

     

     

    If ModifierKeys = (ModifierKeys.Shift + ModifierKeys.Control) Then

    myUltraGrid.Selected.Cells.Add(e.Cell)

     

    Else

    myUltraGrid.Selected.Cells.Clear()

     

     

    End

Reply Children