Reordering Nodes in binding mode

3 posts, 1 answers
  1. Dadan
    Dadan avatar
    6 posts
    Member since:
    Nov 2012

    Posted 07 Dec 2012 Link to this post

    Hi guys,
    beforehand, i use my radtreeview without binding it to another object.
    It works very nice, and i also use drag & drop facility, is very userfriendly.
    No additional code needed to use this drag & drop.

    and then, i use a radtreeview and bind it to datatable. the datatable has hierarchy inside it.
    I use parentmember and childmember property and it works very nice.

    but, when i try to use drag & drop between nodes, it becomes weird.
    e.g : 
    i've 5 node, A, B, C, D, E
    when i try to move node C after the node A (become the second node), it move to the last node (after E).
    the new position not exactly what i want.

    i open the Telerik demo application for Winforms, with the chapter Treeview/Self Referencing, and i also find the same condition with my situation.
    can anyone explain me about this ?

    thx alot for your attention, sorry if my english is not good enouh....
  2. Answer
    Julian Benkov
    Julian Benkov avatar
    1135 posts

    Posted 12 Dec 2012 Link to this post

    Hi Dadan,

    This the normal behavior of the drag & drop operation in this case. In the self-reference scenario the data is stored in one table and when the drag & drop operation is executed the parent key for the drop node is changed to the new one. The operation does not change the order of the records in the DataTable/database. In order to support this operation, the drag & drop operation must find the position of sibling node in the external source and make remove / insert operations at that position. In addition, it should update the related database to insert the record at this position. This operation can be more complex and can not be supported in many data-binding scenarios. For this reason the drag & drop operation is implemented to support the general case and change only the parent key of the DataBountItem using the relation information settings of RadTreeView.

    I hope this information is useful. Let me know if you need further assistance.

    All the best,
    Julian Benkov
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
  3. DevCraft banner
  4. Howard
    Howard avatar
    1 posts
    Member since:
    Dec 2012

    Posted 17 Dec 2012 Link to this post

    Thanks for the answer!
Back to Top