Autoscrolling in GridView while drag drop

3 posts, 0 answers
  1. Martin
    Martin avatar
    1 posts
    Member since:
    Mar 2012

    Posted 19 Apr 2013 Link to this post

    Hi all,

    i have got an issue in using drag and drop functionality in combination with autoscrolling in GridView.
    I must be able to select a cell in gridview and the target cell can only be made visible with scrolling up (may be the target cell is on the upper side of grid and source cell is contained in last row).
    So, if I try to pick up the source cell drag and drop may be initialized and if i move mouse cursor up gridview does not autoscroll up if i come closer and closer to the also visible column headers.

    Is there any way to implement it? If yes it would be very very cool if someone can post a solution for it. :)

    We use RadGridview in combination with the  DragDropManage (without "and").

  2. Nick
    Nick avatar
    593 posts

    Posted 23 Apr 2013 Link to this post

    Hi Martin,

    Have you implemented any custom logic to "Autoscroll" when you drag, or do you expect this to be done out of the box? 
    If that is the case you can look into this example to see how this can be done.

    <telerik:RadGridView x:Name="RadGridView1" GroupRenderMode="Flat"
                                 ShowGroupPanel="False" CanUserResizeRows="True"
                                 ItemsSource="{Binding Customers}"
                                 RowStyle="{StaticResource DraggedRowStyle}"

    Hope this helps!  Regards,
    Nikolay Vasilev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Mark
    Mark avatar
    14 posts
    Member since:
    Sep 2012

    Posted 31 Jul 2013 Link to this post

    Hi all,

    i had the same issue as Martin and use also the ScrollingSettingBehaviour.

    Now I have the problem, that the dragged item a GridViewCell lose his DataContext in the moment,
    that the cell is no longer visible because of scrolling.

    <telerik:RadGridView x:Name="Grid"
                  ItemsSource="{Binding AllRows}"

        <Style x:Key="CellStyle"
               BasedOn="{StaticResource {x:Type telerik:GridViewCell}}"
    <Setter Property="behavior:DragDropBehavior.DragValidationCommand"
          Value="{Binding Path=DataContext.DragValidationCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type wc:ContentPresenter}}}" />
    <Setter Property="behavior:DragDropBehavior.DropValidationCommand"
          Value="{Binding Path=DataContext.DropValidationCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type wc:ContentPresenter}}}" />
    <Setter Property="behavior:DragDropBehavior.DragOverValidationCommand"
          Value="{Binding Path=DataContext.DragOverValidationCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type wc:ContentPresenter}}}" />
    <Setter Property="behavior:DragDropBehavior.DropCompletedCommand"
          Value="{Binding Path=DataContext.DropCompletedCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type wc:ContentPresenter}}}" />

    Has anybody an idea where I made my mistake?
Back to Top