Hello,
I'm trying to implement drag&drop in a radgridview.
I'm using this how to :
http://www.telerik.com/help/wpf/dragdropmanager-howto-draganddrop-within-radgridview.html
Everything is ok, but as soon as I add rowstyle code block, my rows are displayed blank (scrollbar remains visible).
This code is ok :
Do you know what is the root cause ?
Thanks in advance,
Laurent
I'm trying to implement drag&drop in a radgridview.
I'm using this how to :
http://www.telerik.com/help/wpf/dragdropmanager-howto-draganddrop-within-radgridview.html
Everything is ok, but as soon as I add rowstyle code block, my rows are displayed blank (scrollbar remains visible).
This code is ok :
<telerik:RadGridView ItemsSource="{Binding Object.Details.Attributes}" AutoGenerateColumns="True" ScrollViewer.CanContentScroll="True" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Visible" CanUserDeleteRows="False" CanUserInsertRows="False" CanUserReorderColumns="False" CanUserResizeRows="False" CanUserFreezeColumns="False" CanUserSortColumns="False" IsFilteringAllowed="False" RowIndicatorVisibility="Collapsed" ShowGroupPanel="False" DataLoadMode="Asynchronous" IsReadOnly="{Binding IsEditing, Converter={StaticResource InvertBoolConverter}}" EnableRowVirtualization="True" FrozenColumnCount="1" AllowDrop="True" behaviors:RowReorderBehavior.IsEnabled="True" BeginningEdit="Attributes_RadGridView_BeginningEdit" > <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> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn Header="Attribute" DataMemberBinding="{Binding Attribute.TechName}" IsReadOnly="True"/> ....... <telerik:GridViewDataColumn Header="Length" DataMemberBinding="{Binding Attribute.Details.LengthInternal}" IsReadOnly="True"/> </telerik:RadGridView.Columns> </telerik:RadGridView>
But with this code, rows are displayed blank (only headers and scrollbars are visibles) :
<telerik:RadGridView ItemsSource="{Binding Object.Details.Attributes}"
AutoGenerateColumns="True"
ScrollViewer.CanContentScroll="True"
ScrollViewer.HorizontalScrollBarVisibility="Visible"
ScrollViewer.VerticalScrollBarVisibility="Visible"
CanUserDeleteRows="False"
CanUserInsertRows="False"
CanUserReorderColumns="False"
CanUserResizeRows="False"
CanUserFreezeColumns="False"
CanUserSortColumns="False"
IsFilteringAllowed="False"
RowIndicatorVisibility="Collapsed"
ShowGroupPanel="False"
DataLoadMode="Asynchronous"
IsReadOnly="{Binding IsEditing, Converter={StaticResource InvertBoolConverter}}"
EnableRowVirtualization="True"
FrozenColumnCount="1"
AllowDrop="True"
behaviors:RowReorderBehavior.IsEnabled="True"
BeginningEdit="Attributes_RadGridView_BeginningEdit"
>
<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>
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="Attribute" DataMemberBinding="{Binding Attribute.TechName}" IsReadOnly="True"/>
.....
<telerik:GridViewDataColumn Header="Length" DataMemberBinding="{Binding Attribute.Details.LengthInternal}" IsReadOnly="True"/>
</telerik:RadGridView.Columns>
<telerik:RadGridView.RowStyle>
<Style TargetType="telerik:GridViewRow">
<Setter Property="Background" Value="Red"/>
<Setter Property="telerik:DragDropManager.AllowDrag" Value="True" />
</Style>
</telerik:RadGridView.RowStyle>
</telerik:RadGridView>
Do you know what is the root cause ?
Thanks in advance,
Laurent