Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4155
Problems grouping and sorting by an object in XamDataGrid w/XamComboEditor
posted

I have a field in my XamDataGrid "Method".  The values in the columnare of type "PaymentMethod".  A PaymentMethod object is compromised of an integer PaymentMethodID and a string "PaymentMethodDescription".  The field allows the user to select this PaymentMethod via a XamComboEditor from a collection of "ActivePaymentMethods", with DisplayMemberPath set to "PaymentMethodDescription".  The filtering DOES work fine, if I filter Check, it shows the two checks etc.

How do i get Grouping to work on this field?  I set AllowGroupBy=true, but the grouping doesn't group correctly.  If I have a "Check" payment method, a "EFT" payment method, and another "check" payment method and Group By Method, the grid show me "Check", "EFT" and another "Check" group, instead of two groups, Check and EFT, with 2 records in the Check group.  Also, the grid doesn't allow me to sort by Method either.  How can i fix these issues?  I need to group so all of the checks are together, all of the EFTs are together etc.

<igDP:Field Name="PaymentMethod" Label="Method" Width="*" >
<igDP:Field.Settings>
<igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}" AllowGroupBy="True" >
<igDP:FieldSettings.EditorStyle>
<Style TargetType="{x:Type igEditors:XamComboEditor}">
<Setter Property="ItemsSource" Value="{Binding Path=DataContext.ActivePaymentMethods, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"/>
<Setter Property="DisplayMemberPath" Value="PaymentMethodDescription" />
</Style>
</igDP:FieldSettings.EditorStyle>
</igDP:FieldSettings>
</igDP:Field.Settings>
</igDP:Field>