We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Different behavior with Shift-leftClick and Ctrl-leftClick

Set ListBoxSelectionMode = SelectionMode.MultiExtended Set ControllerOptions = GridControllerOptions.OleDataSource In runtime, select 2 consecutive rows (e.g. 1st and 2nd) with Shift+left mouse button. In this case you can drag (mouse cursor transforms into the "drag-cursor") the selection either at the top of the first row or at the bottom of the second one. However, if you select these 2 rows with the Ctrl key, and e.g. the current cell is in the 3rd row, you cannot drag the selection at the top of the first row, only at the top and bottom of the second one. And why QueryCanOleDragRange receives a RangeInfo and not a RangeInfoList object? Check out explorer, it is able to manage Ctrl+LClick selection drags.

3 Replies

AD Administrator Syncfusion Team August 12, 2005 11:12 AM

I think both items you bring up are related. When you do shift to select, you get one GridRangeInfo that was expanded to reflect the shift-select action. And this GridRangeInfo object is added to the Selections collection. If you do a ctl to select an adjcent row, the existing selected GridRangeInfo is not extended to include the adjacent row. Instead another GridRangeInfo object is added to the Selections collection. Our default OLE D&D only supports dragging a single range, the grid.Selections.Ranges.ActiveRange. So, this is why you see the behavior you reported. (And this is the same functionality you will find in Excel, since you cannot even do multiple selections in Excel). You can add your own D&D support to handle multiple ranges, but you might have to make some accomodation for dragging into applications like Excel that do not handle multiple ranges.


AD Administrator Syncfusion Team August 15, 2005 07:27 AM

Just a hint: if ListBoxSelectionMode = SelectionMode.MultiExtended then it''s a list rather than an Excel-like grid. So I think, dragdrop of multiple selections should work...


MC Matyas Csaba April 3, 2007 07:22 AM

Üdvözlöm Váradi Gergely

Levelét olvasva azt láttam Ön is hasonló gondokkal küzd0tt mint én Drag and Drop ügyben.

Haladt-e azóta e témában?
Ha igen tudna számomra öttletet adni hogy lehet több nem összefüggö sort D&D -olni

Tisztelettel
Mátyás Csaba
Csaba.Matyas@saia-burgess.hu

>Set ListBoxSelectionMode = SelectionMode.MultiExtended
>
>Set ControllerOptions = GridControllerOptions.OleDataSource
>
>In runtime, select 2 consecutive rows (e.g. 1st and 2nd) with Shift+left mouse button. In this case you can drag (mouse cursor transforms into the "drag-cursor") the selection either at the top of the first row or at the bottom of the second one.
>
>However, if you select these 2 rows with the Ctrl key, and e.g. the current cell is in the 3rd row, you cannot drag the selection at the top of the first row, only at the top and bottom of the second one.
>
>And why QueryCanOleDragRange receives a RangeInfo and not a RangeInfoList object? Check out explorer, it is able to manage Ctrl+LClick selection drags.

Loader.
Live Chat Icon For mobile
Up arrow icon