Prevent Drag on GridSplitter

2 posts, 0 answers
  1. GuillaumeR
    GuillaumeR avatar
    11 posts
    Member since:
    Jan 2008

    Posted 22 Jun 2010 Link to this post

    Hello,

    Is it possible to prevent drag operation when an user is using a GridSplitter to resize column/row ?

    For example :



            <telerik:RadTreeView IsDragDropEnabled="True" ItemTemplate="{StaticResource TreeItemTemplate}">  
                <telerik:RadTreeView.ItemContainerStyle> 
                    <Style TargetType="{x:Type telerik:RadTreeViewItem}">  
                        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>  
                    </Style> 
                </telerik:RadTreeView.ItemContainerStyle> 
                <telerik:RadTreeView.Items> 
                    <Control Name="control1" Tag="Some text for control1" /> 
                    <Control Name="control2" Tag="Some text for control2" /> 
                </telerik:RadTreeView.Items> 
            </telerik:RadTreeView> 
     
                <DataTemplate x:Key="TreeItemTemplate">  
                    <Border BorderThickness="1" BorderBrush="LightGray" Margin="2" CornerRadius="5">  
                        <Grid> 
                            <Grid.ColumnDefinitions> 
                                <ColumnDefinition Width="Auto"/>  
                                <ColumnDefinition Width="*"/>  
                            </Grid.ColumnDefinitions> 
                            <TextBlock Grid.Column="0" Text="{Binding Name}" Margin="3,0,10,0"/>  
                            <GridSplitter Grid.Column="0" Width="1" Background="LightGray" ResizeDirection="Columns"/>  
                            <TextBlock Grid.Column="1" Text="{Binding Tag}" Margin="3,0,0,0"/>  
                        </Grid> 
                    </Border> 
                </DataTemplate> 
     

    Is there any solution ? I tried t define  dragDrop:RadDragAndDropManager.AllowDrag="False" on GridSplitter but this doesn't work.

    I have the same problem using RadDragDropManager in a templated list (Some draggable items contain Slider).

    Thanks,
    Guillaume.
  2. GuillaumeR
    GuillaumeR avatar
    11 posts
    Member since:
    Jan 2008

    Posted 25 Jun 2010 Link to this post

    Hello,

    I found a solution :

    <GridSplitter Grid.Column="0" Width="1" Background="LightGray" ResizeDirection="Columns" dragDrop:RadDragAndDropManager.AllowDrag="True" dragDrop:RadDragAndDropManager.DragQuery="GridSplitter_DragQuery"/>  
     

            private void GridSplitter_DragQuery(object sender, Telerik.Windows.Controls.DragDrop.DragDropQueryEventArgs e)  
            {  
                e.QueryResult = false;  
                e.Handled = true;  
            }  
     

    Thanks,
    Guillaume.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top