This is a migrated thread and some comments may be shown as answers.

ReorderRow drop is never enabled

7 Answers 58 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 30 Sep 2013, 08:31 PM
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






7 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 01 Oct 2013, 07:04 AM
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 >>
0
Steve
Top achievements
Rank 1
answered on 01 Oct 2013, 03:25 PM
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.
0
Nick
Telerik team
answered on 02 Oct 2013, 07:05 AM
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 >>
0
Steve
Top achievements
Rank 1
answered on 03 Oct 2013, 09:42 PM
The DragEffects are All.  Remember I am using the ReorderBehavior from the Sample with no modifications.
0
Nick
Telerik team
answered on 08 Oct 2013, 07:17 AM
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 >>
0
Alex
Top achievements
Rank 1
answered on 13 Oct 2013, 04:04 PM
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>
0
Nick
Telerik team
answered on 14 Oct 2013, 12:43 PM
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 >>
Tags
GridView
Asked by
Steve
Top achievements
Rank 1
Answers by
Nick
Telerik team
Steve
Top achievements
Rank 1
Alex
Top achievements
Rank 1
Share this question
or