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

RowDrop event - DestinationTableView always returning MasterTableView

1 Answer 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 23 Aug 2011, 09:08 PM
I'm running into a weird issue with drag and dropping of items in the RadGrid.  It turns out in the RowDrop event, the DestinationTableView property of the event args always seems to be returning the MasterTableView, instead of the DetailTableView of the item that I'm dropping the row onto.

Some info on the grid so I don't have to post a gigantic wall of code:
  • The grid itself is just a two level Master/Detail grid, with the MasterTableView named "PrivilegeCategories" and the only DetailTable named "Privileges". 
  • Each grid only has two columns- a boundfield named "Name" and a templatefield with edit/cancel buttons.
  • The grid is bound in the codebehind using NeedDataSource and DetailTableDataBinding events.
  • The MasterTableView has one DataKey named "PrivilegeCategoryID" while the detail table has two, "PrivilegeID,PrivilegeCategoryID"

The DestDataItem property is still returning the correct item; it's only the DestinationTableView that's incorrect:

Debug.Write(e.DestDataItem.OwnerTableView.Name); // correctly writes "Privileges"
Debug.Write(e.DestinationTableView.Name); // incorrectly writes "PrivilegeCategories"

One thought I had was I could work around this by just using e.DestDataItem.OwnerTableView, but that won't work if the row is dropped onto a CommandRow or other non-data row.

Are there some additional troubleshooting steps I could take to diagnose this further?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 26 Aug 2011, 01:13 PM
Hi Jon,

Thank you for reporting this problem, it seems to indeed be a bug in our implementation and we logged it for fixing in future versions of RadControls. Currently, you could try using the DestDataItem as a temporary work around with some additional checks.

As a token of gratitude for pointing out the issue, you can find your Telerik points updated.

Regards,
Tsvetina
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Grid
Asked by
Jon
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or