Problem with DragDrop and Gridview

7 posts, 0 answers
  1. Cameron Molyneux
    Cameron Molyneux avatar
    79 posts
    Member since:
    Jan 2010

    Posted 04 Mar 2010 Link to this post

    I am trying to drag drop from a gridview to another control ,, this works okay but if the grid has a scrollbar that i want to scroll it initiases a drag drop rather than letting me scroll

    this makes scrolling difficult .. even more difficult with the 'thin' scroll bar you get when you apply the windows 7 theme
  2. Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 09 Mar 2010 Link to this post

    Hi Cameron Molyneux,

    It seems that you are making the whole grid draggable (AllowDrag="true"). If you set this property on the individual rows the drag should not start when the mouse is over he scrollbar.

    Your handlers will remain almost the same since you are handling routed events.

    I can suggest setting the AllowDrag property using a row style.

    Do you think this will work for you?

    Best wishes,
    Miroslav
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Cameron Molyneux
    Cameron Molyneux avatar
    79 posts
    Member since:
    Jan 2010

    Posted 12 May 2010 Link to this post

    Sorry I have only just got back to this

    Can you supply an example of this as I don't understand how to use the row style

    many thanks
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 12 May 2010 Link to this post

    Hi Cameron Molyneux,

    You can set the RadDragAndDropManager.AllowDrag property on the individual rows, like so:

    <telerikGrid:RadGridView x:Name="radGridView1" ScrollViewer.HorizontalScrollBarVisibility="Auto"
                IsReadOnly="False" Style="{DynamicResource RadGridCellStyle}">
        <telerikGrid:RadGridView.RowStyle>
            <Style TargetType="{x:Type telerikGridView:GridViewRow}">
                <Setter Property="telerikDragDrop:RadDragAndDropManager.AllowDrag" Value="True" />
            </Style>
        </telerikGrid:RadGridView.RowStyle>
    </telerikGrid:RadGridView>

    Give it a try and let us know fi it works for you.

    Greetings,
    Tina Stancheva
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Cameron Molyneux
    Cameron Molyneux avatar
    79 posts
    Member since:
    Jan 2010

    Posted 12 May 2010 Link to this post

    thanks but i'm also trying to impliment this in WPF but cant .. can you post the wpf version too

    (sorry to be a pain!)
  7. Cameron Molyneux
    Cameron Molyneux avatar
    79 posts
    Member since:
    Jan 2010

    Posted 12 May 2010 Link to this post

                        <telerik:RadGridView x:Name="selectableOrdersGrid" Margin="0"   
                                 d:LayoutOverrides="Width" EditTriggers="None"   
                                 RowIndicatorVisibility="Collapsed"   
                                 AutoGenerateColumns="False" CanUserFreezeColumns="False"   
                                 CanUserReorderColumns="False" CanUserResizeColumns="False"   
                                 CanUserSortColumns="False" ShowGroupPanel="False" Grid.Row="1" 
                                 MouseDoubleClick="selectableOrdersGrid_MouseDoubleClick" 
                                 Style="{DynamicResource RadGridCellStyle}">  
                            <telerik:RadGridView.RowStyle>  
                                <Style TargetType="{x:Type telerik:GridViewRow}">  
                                    <Setter Property="telerik:GridViewRow.AllowDrop" Value="True" />  
                                </Style>  
                            </telerik:RadGridView.RowStyle>  
     
     
                        </telerik:RadGridView> 

    The above code compiles as I have used Allow Drop ...

    If i try to use AllowDrag it complains saying cant find the Style Property AllowDrag
  8. Cameron Molyneux
    Cameron Molyneux avatar
    79 posts
    Member since:
    Jan 2010

    Posted 12 May 2010 Link to this post

    please ignore .. i implemented your example fix incorrectly .. when i implemented it correctly it worked :)
Back to Top
UI for WPF is Visual Studio 2017 Ready