I feel there is a bug in the drag and drop of the ultragrid.
We found that the rows are getting lost in following scenario.
We have a hierarchy displayed in the Ultragrid. When we drag the element we delete the corresponding element in the attached list and add it to the destination row's collection.
We have a two level hierarchy. root node and it has n children [ n should be greater than 4]. These children are siblings of eachother.
steps:
1. drag any (xth) row and drop it on x+1st or x+2nd row. [drag from above to below]
2. x should not be the last or first row.
3. after this step, xth row is lost.
possible cause : we feel that the grid is not handling the indexing of the rows properly.
because this problem doesnt occur when we drag x+1st or x+2nd element to xth element. [ drag from below to above]. Because in this case the index of the destination row is not disturbed by the drag operation.
Hi,
vazeamit said:I feel there is a bug in the drag and drop of the ultragrid.
Since the grid does not have any built-in drag/drop support for rows, I don't see how this could be the result of a bug in the grid.
If there is an error here, it must be an error in the code you are using to move the rows. Can you post the code you are using?
My guess is that you are not adjusting for the fact that once you remove a row (or rows) from the grid, any row below that row will have it's index adjusted downward.
What I would do is keep a reference to the row you want to move to (the row that the user dropped on). Then call the Move method for each row in order and re-get the index of the row where you want to place the rows being dragged each time.
Hi Mike,
Thanks for your reply. Please find attached the demo app I have developed.
When I used the reference to the grid row, it did not have the desired effect. and i observed that the reference starts pointing to a new object.
Thanks,
Amit V.