Getting info of the node where we droping an another node on it.

4 posts, 0 answers
  1. فارغُ تحصیل
    فارغُ تحصیل avatar
    2 posts
    Member since:
    Jun 2015

    Posted 12 Jun 2015 Link to this post

    Hi guys!

          I have a data-bound RadTreeview control bound to my "ChartOfAccount" table. I have an Idea to drag a node from 1st Parent node to 2nd Parent.

    i.e : An Account Fuel Expenses from the Node Utilities Expenses to Administrator Expenses. for this purpose I am getting the COA_ID of the Fuel Expenses by event  Treeview_DrageStarted(....) like : Treeview1.SelectedValue (where SelectedValue is the Coa_ID column). After that Now I have started draging this node from Utilities Expenses to administrator Expenses, therefore I will need the Parent node SELECTEDVALUE which will help me to make a condition for UPDATE QUERY.

     

    please someone understand this problem because I am weak in english, and suggest me the solution that How to get the Parent Node SELECTEDVALUE.

  2. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 12 Jun 2015 Link to this post

    Hello Alamdar,

    Thank you for writing.

    I would recommend you to have a look at the TreeView >> Drag and Drop in bound mode help article which is quite useful on this topic. RadTreeView uses TreeViewDragDropService to perform the drag and drop operation. The PreviewDragOver event allows you to control on what target the node being dragged can be dropped on. The RadDragOverEventArgs.HitTarget property gives you access to the target TreeNodeElement from which you can get the RadTreeNode and its parent to check the DataBoundItem. Thus, you can construct the condition for the drop operation.

    I hope this information helps. Should you have further questions, I would be glad to help.
     
    Regards,
    Dess
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. فارغُ تحصیل
    فارغُ تحصیل avatar
    2 posts
    Member since:
    Jun 2015

    Posted 13 Jun 2015 in reply to Dess Link to this post

    Thank you for your response

    but I did my job this way

    treeview_NodeDragFeedback(sender As Object, e As TreeDragFeedbackEventArgs) Handles treeview.NodeDragFeedback
             Target_SubgroupID = GetColumnData("ChartOfAcc", "Coaid", "AcTitle='" & e.ParentNode.Text & "'")
     
    end sub
    Private Sub tvc_QueryContinueDrag(sender As Object, e As QueryContinueDragEventArgs) Handles tvc.QueryContinueDrag
     
    'REST OF IMPLEMENTATION CODE GOES HERE... i.e Updating database accordingly
     
    end sub

     

     

     

     

     

     

  5. Dess
    Admin
    Dess avatar
    1601 posts

    Posted 16 Jun 2015 Link to this post

    Hello Alamdar,

    Thank you for writing back.

    Feel free to use this approach which suits your requirement best. TreeView >> Drag and Drop section in the online documentation is quite useful on this topic.

    I hope this information helps.

    Regards,
    Dess
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top