Prevent Drag and drop between multiple RadGridView

7 posts, 0 answers
  1. Navaneeth
    Navaneeth avatar
    5 posts
    Member since:
    Jan 2011

    Posted 27 Jan 2011 Link to this post

    Hello,

    I have two RadGridView both allows Drag & Drop of rows. We use the method explained in the article http://www.telerik.com/help/silverlight/raddraganddrop-within-radgridview.html. Since both the grids allows drag & drop, user can drag from one grid and drop on the other. This will fail as the backing datacontext for both grids are different and the type conversion fails.

    I am looking for a method where the grid won't allow dropping on to the other droppable grids. Is there a way to achieve this?

    Any help would be appreciated. 
  2. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 27 Jan 2011 Link to this post

    Hello Navaneeth,

    you can check whether the e.Options.Payload is the correct type for the destination grid in DropQuery event and if not set e.QueryResult = false;

    Best wishes,
    Tsvyatko
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
  4. Navaneeth
    Navaneeth avatar
    5 posts
    Member since:
    Jan 2011

    Posted 28 Jan 2011 Link to this post

    Thanks and that seems to do the trick. BTW, we have another issue with the drag & drop approach. Drag & drop on a grid with more number of rows seems to be very slow. We tried it on a grid which has 70+ rows and it took around 10 seconds to drop just one row. Is there any way to fix this too?

    Thanks for your help.
  5. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 28 Jan 2011 Link to this post

    Hello Navaneeth,

    I suspect this could be either due to slow remove/insert operations or RowVirtualization turned off.

    I can suggest the following:

     - try perform row reorder from button to eliminate drag/drop element.
     - check whether  the grid is not placed within StackPanel or RowVirtualization turned off, which could cause measuring of all rows.

    Regards,
    Tsvyatko
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  6. Navaneeth
    Navaneeth avatar
    5 posts
    Member since:
    Jan 2011

    Posted 28 Jan 2011 Link to this post

    Thanks again for the reply. GridView has row virtualization turned on (EnableRowVirtualization="True") and it is not contained in a StackPanel. We are still facing the slowness in Drag & Drop. Is there any other property that controls the virtualization or performance of the row reorder? 

  7. Milan
    Admin
    Milan avatar
    1989 posts

    Posted 28 Jan 2011 Link to this post

    Hello Navaneeth,

    Have you tried to execute the row reorder logic without using drag and drop as my colleague has suggested?

    Regards,
    Milan
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  8. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 28 Jan 2011 Link to this post

    Hi Navaneeth,

    Unfortunately, we are unable suggest solution without some additional information about the specific scenario.
    Could you please, open a support ticket and attach sample project that demonstrate the problem.

    Kind regards,
    Tsvyatko
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top
DevCraft banner