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.

Drag&Drop with Multiselection

Thread ID:

Created:

Updated:

Platform:

Replies:

104393 Jul 16,2012 08:33 AM Aug 1,2012 07:29 PM WPF 3
loading
Tags: GridControl
Michael Krämer
Asked On July 16, 2012 08:33 AM

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 05:37 AM

 

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 12:25 PM

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 07:29 PM

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.

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.

;