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

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

3 Answers 114 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
فارغُ تحصیل
Top achievements
Rank 1
فارغُ تحصیل asked on 12 Jun 2015, 05:22 AM

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.

3 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 12 Jun 2015, 11:03 AM
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
0
فارغُ تحصیل
Top achievements
Rank 1
answered on 13 Jun 2015, 05:19 AM

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

 

 

 

 

 

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 16 Jun 2015, 07:30 AM
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
Tags
Treeview
Asked by
فارغُ تحصیل
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
فارغُ تحصیل
Top achievements
Rank 1
Share this question
or