Hi,
I have a gridcontrol, with an Ordinal column. I was helped in the past by enabling sorting on my columns to get it to sort – https://supportcenter.devexpress.com/ticket/details/t1242479
However, I have a different dialog that is generating columns based on a template (this is derived from a separate devexpress example). My type is Ordinal (referenced in the link above, a very simple type, which implements IComparer and IComprable).
When I enable AllowSorting, I get an error when I go to sort, directly on the Panel. Is there some type of configuration changes I can make to get sorting to work my record types, in this dynamically generated column set?
XAML<DataTemplate x:Key="BindingColumnTemplate">
<!-- How to build a header column -->
<dxg:GridColumn
Width="{Binding Path=(dxci:DependencyObjectExtensions.DataContext).Width, RelativeSource={RelativeSource Self}}"
MinWidth="{Binding Path=(dxci:DependencyObjectExtensions.DataContext).MinWidth, RelativeSource={RelativeSource Self}}"
MaxWidth="{Binding Path=(dxci:DependencyObjectExtensions.DataContext).MaxWidth, RelativeSource={RelativeSource Self}}"
localBindings:BindingHelper.Path="{Binding Path=(dxci:DependencyObjectExtensions.DataContext).FieldName, RelativeSource={RelativeSource Self}}"
AllowSorting="True"
Header="{Binding Path=(dxci:DependencyObjectExtensions.DataContext).Header, RelativeSource={RelativeSource Self}}"
HeaderToolTip="{Binding Path=(dxci:DependencyObjectExtensions.DataContext).ToolTip, RelativeSource={RelativeSource Self}}"
Visible="{Binding Path=(dxci:DependencyObjectExtensions.DataContext).IsVisible, RelativeSource={RelativeSource Self}}" />
</DataTemplate>
C#public static readonly DependencyProperty PathProperty = DependencyProperty.RegisterAttached(
"Path",
typeof(string),
typeof(BindingHelper),
new PropertyMetadata((d, e) =>
{
if (!string.IsNullOrWhiteSpace(e.NewValue as string))
{
((GridColumn)d).Binding = new Binding((string)e.NewValue)
{
Mode = BindingMode.OneWay
};
}
})