We are using an Ultrawingrid control to display a hierarchy. It has the hierarchical list object as a datasource.
We have implemented a drag drop functionality as follows. The user selects a row & drops it on another one and the dragged item should become a child of the destination item.
If we perform drag and drop on the siblings, the functionality fails in following scenario.
Drag the element and drop it on the element below in the sibling list.
Example . we have a element 'root' and it has 10 children.
if we drag child 3 and drop on child 5, child 3 should move under child 5 and become its 'child'. And this should be visible on UI.
However, in our case, we dont see this change reflected on the UI. Instead it appears as though we have lost the element [child 3 in this case] for ever. We have to
We have to click on the destination element [child 5 in this case] to see the change. Clicking makes the change visible.
Please suggest a solution for this issue. We have attatched a demo app to explain the issue we are facing.
Note : If the dragged element is below the destination element in the sibling list, functionality works fine.
***************************************//******************************************** The attached sample app is developed on .Net 3.5 & windows 7 environment. 1. Launch the sample app. 2. Expand the hierarchy For item 'Manager2' 3. Drag item Employee7 on Employee 12. 4. Employee7 moves under Employee12 but it becomes invisible. 5. On clicking Employee12 again, Employee7 gets visible as child of Employee12. 6. Even if Employee8 dropped to any Employee from 9 to 23, this issue occurs. 7. Same way if Employee13 dropped to any Employee from 14 to 23, this issue occurs. 8. On click of Reset button hierarchy gets rebuilt to test the issue again.
***************************************//********************************************
The attached sample app is developed on .Net 3.5 & windows 7 environment.
1. Launch the sample app.
2. Expand the hierarchy For item 'Manager2'
3. Drag item Employee7 on Employee 12.
4. Employee7 moves under Employee12 but it becomes invisible.
5. On clicking Employee12 again, Employee7 gets visible as child of Employee12.
6. Even if Employee8 dropped to any Employee from 9 to 23, this issue occurs.
7. Same way if Employee13 dropped to any Employee from 14 to 23, this issue occurs.
8. On click of Reset button hierarchy gets rebuilt to test the issue again.
Hello,
Thank you very much for attached sample. I was able to reproduce your issue. If you take a look at your method MoveElements() you will see that you nerver enter in IF condition: if (ugrDestinationRow.ChildBands[0].Rows.Count > 0) when you drag and drop a row from "Manager2" to another row again in "Manager2". So this is the reason for that behavior.If you want to fix this issue, maybe one possible way is to modify the method MoveElements(). Please take a look at the code to see my modifications. Please if you have any questions, do not hesitate to ask meRegards
Hi Georgi,
Thanks for the modified code.
The solution provided works for single hierarchy but the issue still persists if we drag the element from top to bottom in the nested hierarchy.
To make things more clear, consider the example that was initially provided with this post .
Example .
1. Launch the sample app [.i.e. Modified by you]
Please suggest a solution for this issue.
4. Employee7 moves under Employee12 and is Visible now with your solution.
5. Drag item Employee19 on Employee 21
6. Employee19 moves under Employee21 and is Visible. 7. Now drag item Employee8 on Employee 7.[i.e Item under Employee 12.]
6. Employee19 moves under Employee21 and is Visible.
7. Now drag item Employee8 on Employee 7.[i.e Item under Employee 12.]
8. Employee8 moves under Employee7 but Employee 7 as well as Employee 8 is Invisible now. Also the hierarchy created for Employee 21 gets lost. 9. On clicking Employee12 again, Employee7 gets Visible as child of Employee12 10. On clicking Employee21 again, Employee19 gets Visible as child of Employee21.
8. Employee8 moves under Employee7 but Employee 7 as well as Employee 8 is Invisible now. Also the hierarchy created for Employee 21 gets lost.
9. On clicking Employee12 again, Employee7 gets Visible as child of Employee12
11. This issue occurs if we try to further nest the hierarchy by the dragging the elements above Employee 12 and dropping the them in nested fashion.
Hi,
Did you have a time to look at the sample. Please send me a feedback.
Regards
I reproduce your issue follow the steps above all, but Mike is right about the deep hierarchy.I don`t know your scenario, but if you want to represent the company structure, maybe one possible appraoch is to use UltraTree component. The component (UltraTree ) has view style: Grid. Please take a look at the sample browser, there are sample for drag and drop functionality and Grid view style. You could run sample browser from : Start->All programs ->Infragistics -> NetAdvantage 2010.3->Windows Forms ->Samples.
Please if you have any questions, do not hesitate to ask meRegardsGeorgi
Have you been able to resolve your issue ? Did you take a look at the UltraTree component ? Please do not hesitate to ask me