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

Reordering Expander inside the Stackpanel

1 Answer 72 Views
Expander
This is a migrated thread and some comments may be shown as answers.
Sakthi
Top achievements
Rank 1
Sakthi asked on 26 Sep 2012, 06:30 AM
Hi All,

I want to Reorder the RasExpander Control with the help of DragDropManager inside the Stackpanel. Can you please guide me how to do this? Please help me with the sample if possible.

Thanks,
 Sakthi

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 29 Sep 2012, 07:58 AM
Hi Sakthi,

I understand that you need  to move RadExpander control which could be a bit tricky, because the DragDropManager works best with data objects rather than UIElements. This is why it might be easier if you define the RadExpanders in a ListBox.ItemTemplate and build their content based on data items.Then you'll be able to use the approach described in the DragDropManager GettingStarted article or the ListBoxDragDropBehavior to reorder the items in the ListBox control.

However, there is a way to achieve this:
  • First you have to set to True the telerik:DragDropManager.AllowCapturedDrag and AllowDrop properties of all RadExpander controls that you need to move.
  • Then you have to attach a Drag Initialize Handler and a Drop Handler by using AddDragInitializeHandler and AddDropHandler methods of the DragDropManager. In your case this must be done manually for each expander.

Please find the attached project bellow. And let me know if it satisfies your needs.

All the best,
TeamX2_Pavel
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
Expander
Asked by
Sakthi
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or