I have a XamGrid with a DragDropManager and the sort does not work.
If I comment out the DragDropManager sort works again.
Is this a bug, and if so is there a work around?
Thanks,
-Mark
Code Below:
<ig:XamGrid Grid.Row="1" x:Name="_endPoints" SelectedRowsCollectionChanged="_endPoints_SelectedRowsCollectionChanged" ItemsSource="{Binding EndPoints}" AutoGenerateColumns="False"> <ig:DragDropManager.DragSource> <ig:DragSource IsDraggable="{Binding Source={StaticResource DataContextProxy}, Path=DataSource.IsEditMode, Converter={StaticResource NotBoolConverter}}" DragChannels="EndPoint" DragStart="DragSource_DragStart" DragEnd="DragSource_DragEnd" Drop="DragSource_Drop"> <ig:DragSource.DragTemplate> <DataTemplate x:Name="dragTemplate"> <ListBox Visibility="Visible" x:Name="dtStackPanel" ItemsSource="{Binding Path=Data}" Opacity=".5"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" Background="{StaticResource GreenGradientBrush}" Margin="-5"> <TextBlock Width="150" FontSize="11" Style="{StaticResource NormalText}" Margin="5" Text="{Binding Name}" /> <TextBlock Width="100" FontSize="11" Style="{StaticResource NormalText}" Margin="5" Text="{Binding IpAddress}"/> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> </DataTemplate> </ig:DragSource.DragTemplate> <ig:DragSource.CopyCursorTemplate> <DataTemplate> <Image Height="30" Width="30" Source="/ctConsole;Component/Assets/Images/rollover.png" /> </DataTemplate> </ig:DragSource.CopyCursorTemplate> <ig:DragSource.DropNotAllowedCursorTemplate> <DataTemplate> <Image Height="30" Width="30" Source="/ctConsole;Component/Assets/Images/critical.png" /> </DataTemplate> </ig:DragSource.DropNotAllowedCursorTemplate> <ig:DragSource.MoveCursorTemplate> <DataTemplate> <Image Height="30" Width="30" Source="/ctConsole;Component/Assets/Images/rollover.png" /> </DataTemplate> </ig:DragSource.MoveCursorTemplate> </ig:DragSource> </ig:DragDropManager.DragSource> <ig:XamGrid.Columns> <ig:TemplateColumn Key="SecurityConfig" Width="175" FilterColumnSettings="{StaticResource FilterColumnSettingsDefault}" Visibility="{Binding Source={StaticResource DataContextProxy}, Path=DataSource.PoliciesViewModel.SecurityGroupTreeViewModel.IsFolderSelected, Converter={StaticResource BoolToVisibilityConverter}}"> <ig:TemplateColumn.FilterEditorTemplate> <DataTemplate> <TextBox Text="{Binding Value, Mode=TwoWay}"/> </DataTemplate> </ig:TemplateColumn.FilterEditorTemplate> <ig:TemplateColumn.HeaderTemplate> <DataTemplate> <TextBlock Text="Security Group" /> </DataTemplate> </ig:TemplateColumn.HeaderTemplate> <ig:TemplateColumn.ItemTemplate> <DataTemplate> <HyperlinkButton Click="NavigateSecurityGroup_Click"> <HyperlinkButton.Content > <TextBlock Text="{Binding SecurityConfig}" /> </HyperlinkButton.Content> </HyperlinkButton> </DataTemplate> </ig:TemplateColumn.ItemTemplate> </ig:TemplateColumn> <ig:TextColumn Key="Name" Width="150" > <ig:TextColumn.HeaderTemplate> <DataTemplate> <TextBlock Text="Endpoint" /> </DataTemplate> </ig:TextColumn.HeaderTemplate> </ig:TextColumn> <ig:TextColumn Key="Status" /> <ig:TextColumn Key="Mode" > <ig:TextColumn.HeaderTemplate> <DataTemplate> <TextBlock Text="Posture" /> </DataTemplate> </ig:TextColumn.HeaderTemplate> </ig:TextColumn> <ig:TextColumn Key="OperatingSystem" > <ig:TextColumn.HeaderTemplate> <DataTemplate> <TextBlock Text="OS" /> </DataTemplate> </ig:TextColumn.HeaderTemplate> </ig:TextColumn> <ig:TextColumn Key="IpAddress" > <ig:TextColumn.HeaderTemplate> <DataTemplate> <TextBlock Text="IP Address" /> </DataTemplate> </ig:TextColumn.HeaderTemplate> </ig:TextColumn> <ig:TextColumn Key="AgentVersion" > <ig:TextColumn.HeaderTemplate> <DataTemplate> <TextBlock Text="Agent Version" /> </DataTemplate> </ig:TextColumn.HeaderTemplate> </ig:TextColumn> <ig:TextColumn Key="EventTimeAsDateTime" IsReadOnly="True"> <ig:TextColumn.HeaderTemplate> <DataTemplate> <TextBlock Text="Last Update" /> </DataTemplate> </ig:TextColumn.HeaderTemplate> </ig:TextColumn> </ig:XamGrid.Columns> <ig:ContextMenuService.Manager> <ig:ContextMenuManager ModifierKeys="None"> <ig:ContextMenuManager.ContextMenu> <ig:XamContextMenu Opening="XamContextMenu_Opening"/> </ig:ContextMenuManager.ContextMenu> </ig:ContextMenuManager> </ig:ContextMenuService.Manager> <ig:XamGrid.FilteringSettings> <ig:FilteringSettings AllowFiltering="FilterMenu" /> </ig:XamGrid.FilteringSettings> <ig:XamGrid.ColumnMovingSettings> <ig:ColumnMovingSettings AllowColumnMoving="Indicator" /> </ig:XamGrid.ColumnMovingSettings> <ig:XamGrid.ColumnChooserSettings> <ig:ColumnChooserSettings AllowHiddenColumnIndicator="True" AllowHideColumnIcon="True" /> </ig:XamGrid.ColumnChooserSettings> <ig:XamGrid.SelectionSettings> <ig:SelectionSettings RowSelection="Multiple" CellClickAction="SelectRow"/> </ig:XamGrid.SelectionSettings> <ig:XamGrid.RowSelectorSettings> <ig:RowSelectorSettings Visibility="Collapsed" EnableRowNumbering="False"/> </ig:XamGrid.RowSelectorSettings> <ig:XamGrid.EditingSettings> <ig:EditingSettings AllowEditing="{Binding Source={StaticResource DataContextProxy}, Path=DataSource.IsEditMode, Converter={StaticResource BoolToAllowEditingConverter}}" IsMouseActionEditingEnabled="SingleClick" IsEnterKeyEditingEnabled="True" IsF2EditingEnabled="True" IsOnCellActiveEditingEnabled="False" /> </ig:XamGrid.EditingSettings> </ig:XamGrid>
Hello,,
Excuse me for the late post.
If your target is to make draggable only the rows of the grid I can show you how you can extend the XamGrid and use it as wrapper around DragDropManager. Then you can use this built-in drag-drop row support. Are you interested of workaround like this one?
Best regards.
PPilev.
Actually, this is fixed if we can upgrade to the newer version from another work-around I have in the Drag Start method.
The problem is the problem of the disappearing cursor when we upgrade past version .1029. I replied to you on another thread for that. I wanted to see if you had any ideas before ripping out BusyIndicators in our app.
Hello Mark,
I’ve attached sample project where you can find a control that extends XamGrid with built in drag-drop support for the data rows. This control exposes all of events found in DragSource and supports RowDragTemplate and RowDragChannels as well. Implemented in this way drag-drop does not affect any of the built in functionalities of the standard XamGrid. I hope it will cover your needs.
Regards.
Plamen.
Ran into an issue with this solution in conjunction with the persistence framework, where it wasn't restoring the DragChannels property correctly. Support helped me with the cause, thought I would post it here for anyone else utilizing this solution with persistence framework.
Hello Jason,
I have heard back from development and it turns out there is no issue with the framework, but rather the issue is coming from you using this TypeConverter: [TypeConverter(typeof(StringToDragDropChannelsCollectionConverter))] , which is meant for the DragDrop framework internal use. In order for it to be compliant with the persistence framework it should have a couple more methods than the initially designed ones, so I have modified it for you like so:
public class UsefulConverter : TypeConverter
{
public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
if (sourceType == typeof(string))
return true;
}
else
return base.CanConvertFrom(context, sourceType);
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
ObservableCollection<string> temp = new ObservableCollection<string>();
if (value is string)
foreach (var item in value.ToString().Split(','))
temp.Add(item);
return temp;
return base.ConvertFrom(context, culture, value);
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)
var resolvedCollection = value as ObservableCollection<string>;
if (resolvedCollection != null)
return string.Join(",", resolvedCollection);
return null;
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
return destinationType == typeof(string);
Or better yet create a whole new TypeConverter of your own with this functionality.
Please let me know if I can be of any further assistance on the matter.