This is a migrated thread and some comments may be shown as answers.

Drag&Drop issue

2 Answers 43 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Raul
Top achievements
Rank 1
Raul asked on 17 Sep 2016, 02:00 PM

Hello,

when in edit mode with a row validation error it is still possible to perform Drag&Drop operations. They are not visible while performing the Drop, but the rows will be sorted just after clearing the row validation error.

Greeting

Raul

2 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 21 Sep 2016, 08:52 AM
Hi Raul,

I suppose that you are using our RowReorderBehaviour for reordering the rows. If yes, you can stop the drag&drop operation when the grid is in edit mode. In order to achieve this, you can use a boolean flag in OnDragInitialize method of the behaviour like so:
private void OnDragInitialize(object sender, DragInitializeEventArgs e)
       {
           if (flag)
           {
               return;
           }
           var sourceRow = e.OriginalSource as GridViewRow ?? (e.OriginalSource as FrameworkElement).ParentOfType<GridViewRow>();
           if (sourceRow != null && sourceRow.Name != "PART_RowResizer")
           {
                           .
                           . 
                           .

You can set the flag in GridView's BeginningEdit and RowEditEnded events.

Let me know if you need further assistance on this.

Regards,
Yoan
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Raul
Top achievements
Rank 1
answered on 21 Sep 2016, 01:29 PM
thanks, it helped me a lot :)
Tags
GridView
Asked by
Raul
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Raul
Top achievements
Rank 1
Share this question
or