ReorderRow drop is never enabled

8 posts, 0 answers
  1. Steve
    Steve avatar
    124 posts
    Member since:
    Jun 2011

    Posted 30 Sep 2013 Link to this post

    Hello,
    I believe I've copied all the necessary code and settings from the ReorderRows example; however the drop is never enabled.  I'm using the DropIndicationDetails and RowReorderBehavior classes with no changes.  The code in my UserControl is as follows (only pertinent snippet is included)...

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/AM.Core;Component/UI/ResourceDictionaries/UID
                <ResourceDictionary Source="/AM.Core;Component/UI/ResourceDictionaries/Dat
            </ResourceDictionary.MergedDictionaries>
            <localProperties:Settings x:Key="Settings" />
            <Style TargetType="telerik:GridViewRow"
                   x:Key="DraggedRowStyle"
                   BasedOn="{StaticResource {x:Type telerik:GridViewRow}}">
                <Setter Property="telerik:DragDropManager.AllowDrag"
                        Value="True" />
                <Setter Property="AllowDrop"
                        Value="True" />
            </Style>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <telerik:RadGridView x:Name="AccountGroupsGridView"
                             HorizontalAlignment="Stretch"
                             VerticalAlignment="Stretch"
                             Width="{Binding ElementName=LayoutRoot, Path=ActualWidth}"
                             Height="{Binding ElementName=LayoutRoot, Path=ActualHeight}"
                             ScrollViewer.VerticalScrollBarVisibility="Auto"
                             ScrollViewer.HorizontalScrollBarVisibility="Auto"
                             IsSynchronizedWithCurrentItem="True"
                             AutoGenerateColumns="False"
                             VerticalGridLinesBrush="Transparent"
                             AlternationCount="2"
                             AlternateRowBackground="AliceBlue"
                             CanUserDeleteRows="True"
                             CanUserInsertRows="True"
                             ColumnWidth="*"
                             ShowGroupPanel="False"
                             RowIndicatorVisibility="Collapsed"
                             KeyboardNavigation.DirectionalNavigation="Cycle"
                             KeyboardNavigation.TabNavigation="Cycle"
                             ItemsSource="{Binding Path=AccountGroups}"
                             RowStyle="{StaticResource DraggedRowStyle}"
                             AllowDrop="True"
                             amUI:RowReorderBehavior.IsEnabled="True">
            <telerik:RadGridView.Resources>
                <DataTemplate x:Key="DraggedItemTemplate">
                    <StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Dragging:" />
                            <TextBlock Text="{Binding CurrentDraggedItem}"
                                       FontWeight="Bold" />
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding CurrentDropPosition}"
                                       FontWeight="Bold"
                                       MinWidth="45" />
                            <TextBlock Text=", ("
                                       Foreground="Gray" />
                            <TextBlock Text="{Binding CurrentDraggedOverItem}" />
                            <TextBlock Text=")"
                                       Foreground="Gray" />
                        </StackPanel>
                    </StackPanel>
                </DataTemplate>
            </telerik:RadGridView.Resources>

    Any help would be much appreciated.
    Thanks in advance,
    Steve






  2. Nick
    Admin
    Nick avatar
    593 posts

    Posted 01 Oct 2013 Link to this post

    Hello Steve,

    Actually, the snippet you posted does not seem to have anything wrong. 
    Furthermore, I am not sure I understand the case correctly. 
    What do you mean by however the drop is never enabled.  Does this relate to the whole behavior, or just the Drop functionality? Can you get the Drag started, or nothing is actually working? 

    I am looking forward to your response! 

    Regards,
    Nik
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Steve
    Steve avatar
    124 posts
    Member since:
    Jun 2011

    Posted 01 Oct 2013 Link to this post

    The drag starts, and drop position is correctly reported; however the little arrow never appears, only the circle slash indicating the drop is disabled. When dropped, OnDrop is never called.
  5. Nick
    Admin
    Nick avatar
    593 posts

    Posted 02 Oct 2013 Link to this post

    Hello Steve,

    This seems very interesting. Can you check what are the DragEffects in the DragOver event prior to the Drop? If the effects are None, the Drop event will never be fired. You can override them yourself and set them to anything different from None, to be able to drop.

    Hope this helps! 

    Regards,
    Nik
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Steve
    Steve avatar
    124 posts
    Member since:
    Jun 2011

    Posted 03 Oct 2013 Link to this post

    The DragEffects are All.  Remember I am using the ReorderBehavior from the Sample with no modifications.
  7. Nick
    Admin
    Nick avatar
    593 posts

    Posted 08 Oct 2013 Link to this post

    Hello Steve,

    We are not sure what exactly goes wrong in this case, everything seems correct in the code. 

    May I ask you to send the project you are testing in via a support ticket so we can debug it on our side and see what goes wrong exactly? 

    Thank you in advance! 

    Regards,
    Nik
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  8. Alex
    Alex avatar
    1 posts
    Member since:
    Dec 2010

    Posted 13 Oct 2013 Link to this post

    I have exact same problem. Drop indicator is a crossed circle.
    my GridView:

    <telerikGridView:RadGridView Grid.Row="2"
                                             ItemsSource="{Binding SelectedItems, Mode=TwoWay}"
                                             IsFilteringAllowed="False"
                                             Height="230"
                                             Width="Auto"
                                             IsReadOnly="True"
                                             AllowDrop="True"
                                             DataLoadMode="Synchronous"
                                             SelectionMode="Extended"
                                             ScrollMode="RealTime"
                                             AutoGenerateColumns="True"
                                             CanUserResizeColumns="False"
                                             CanUserFreezeColumns="False"
                                             CanUserReorderColumns="False"
                                             RowIndicatorVisibility="Collapsed"
                                             ShowGroupPanel="False"
                                             CanUserSortColumns="True"
                                             RowStyle="{StaticResource DraggedRowStyle}"
                                             behaviors:RowReorderBehavior.IsEnabled="True"
                                             controls:ScrollingSettingsBehavior.IsEnabled="True"
                                             controls:ScrollingSettingsBehavior.ScrollAreaPadding="30"
                                             controls:ScrollingSettingsBehavior.ScrollStep="24"
                                             controls:ScrollingSettingsBehavior.ScrollStepTime="00:00:00.05">
                    <telerikGridView:RadGridView.Resources>
                        <DataTemplate x:Key="DraggedItemTemplate" DataType="viewModels:DropIndicationDetailsViewModel">
                            <StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="Dragging:" />
                                    <TextBlock Text="{Binding CurrentDraggedItem}"
                                               FontWeight="Bold" />
                                </StackPanel>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock Text="{Binding CurrentDropPosition}"
                                               FontWeight="Bold"
                                               MinWidth="45" />
                                    <TextBlock Text=", ("
                                               Foreground="Gray" />
                                    <TextBlock Text="{Binding CurrentDraggedOverItem}" />
                                    <TextBlock Text=")"
                                               Foreground="Gray" />
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </telerikGridView:RadGridView.Resources>
                </telerikGridView:RadGridView>
  9. Nick
    Admin
    Nick avatar
    593 posts

    Posted 14 Oct 2013 Link to this post

    Hi Alex,

    Again, we are not able to reproduce the problem. 
    Please open a support ticket with a project that can reproduce the problem to get the issue resolved.

    Thank you in advance! 

    Regards,
    Nik
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
UI for WPF is Visual Studio 2017 Ready