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

NullReferenceException in DragDropBehaviour<TSTate> class

1 Answer 57 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Jun
Top achievements
Rank 1
Jun asked on 19 May 2020, 06:50 PM

Hallo,

I use DragDropManager to drag & drop items between RadListBoxe A and RadListBox B. It works good. But it will cause the program crashed when I try following:

Because the RadListBox B is not allowed to have TWO items on the same time, so existing item must be "swap" by new one. I remove the existing item and replaced by new one via code. It works good only when it drops under existing item. And, when I drop the new item before the existing item, the program will be crashed by NullReferenceException,  I found the exception caused by  DragDropBehaviour<TSTate> class. See screenshots provided.

Please, solutions, urgent.

Tam

 

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 22 May 2020, 08:52 AM

Hello Jun,

Can you show how exactly do you implement the swap of the items in code? Also, can you share how the listboxes are setup in XAML and in code?

Regards,
Martin Ivanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
DragAndDrop
Asked by
Jun
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or