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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Drag&Drop with Multiselection

Thread ID:

Created:

Updated:

Platform:

Replies:

104393 Jul 16,2012 12:33 PM UTC Aug 1,2012 11:29 PM UTC WPF 3
loading
Tags: GridControl
Michael Krämer
Asked On July 16, 2012 12:33 PM UTC

Dear Syncfusion Support Team,

I added to the GridDataControl the ability to Drag and Drop the selected elements.                               

The problem is, if i select more than one elemt in the grid and then I drag the elements, only the draged element is selected and the other ones are deselected.

I think this depends one the event to select an element in the DataGrid. The selection changes if the left mouse button was pressed, in my case the selection should change if the left mouse button wsa clicked.

Is it possible to change the event for selecting an element in the DataGrid?

I attached a short Video and Code example.

Best regards,

Michael



DragAndDropPrototype_c9a06539.zip

Rajasekar G [Syncfusion]
Replied On July 17, 2012 09:37 AM UTC

 

Hi Kramer,

 

Thank you for your update.

 

You can achieve your requirement by using the below code snippet,

 

Code Snippet[C#]:

 

       

DragGrid.Model.SelectionChanging += new GridSelectionChangingEventHandler(Model_SelectionChanging);

 

        void Model_SelectionChanging(object sender, GridSelectionChangingEventArgs e)

        {

            if (e.Reason == GridSelectionReason.MouseDown && (sender as GridDataTableModel).SelectedRanges.AnyRangeContains(e.ClickRange))

            {

                e.Cancel = true;

            }

        }

 

 

 

Please find the modified sample in the below location,

 

Sample: ModifiedSample.zip

 

Please let us know if you have any queries.

 

Thanks,

Raja sekar .G


Michael Krämer
Replied On July 17, 2012 04:25 PM UTC

Hello Mr. Rajasekar,
thank you for the quick response. For now the Problem is solved. But with this fix a new Problem occurs instead, if I want to select one element in the range of selected elements, it is not possible. So i have to select one element outside of the range and then i can select the one which was in the range of the selected elements.

Regards
Michael

Rajasekar G [Syncfusion]
Replied On August 1, 2012 11:29 PM UTC

Hi Kramer,

 

Thanks for the patience.

 

We have analyzed your query and we have modified the sample based as per your requirement and it can be download from the following location.

 

Sample Location: Sample.zip

 

Note: In this case if you start drag the SelectedRange by using mouse  click along with ctrl key the selected range will appear correctly

 

Thanks,

Raja sekar.G


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;