Home Forums WPF controls Xceed DataGrid for WPF PropertyGroupDescription(null, converter) fails

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #23753 |

    I am trying to add a grouping based on a property of an attached property of an object in Items:

    Item has an attached property GroupHelper.Group which in turn has a property Name

    I have not been able to reference this property directly with a PropertyPath. Therefor I programmatically add the grouping:

    dgc.Items.GroupDescriptions.Add(new PropertyGroupDescription(null, converter));

    1st par ‘null’ means the Item itself is forwarded to the converter.
    The converter retrieves and returns the Group’s Name property.

    However, when xceed’s DataGridControl creates Groups internally an exception is thrown complaining about a ‘description’ parameter being null…


    Imported from legacy forums. Posted by Nelis (had 810 views)

    Xceed Support
    Post count: 5658

    There effectively seems to be a problem with creating a PropertyGroupDescription with a null first parameter…

    I filed a bug report for this… We’ll keep you posted on the mater.

    In a way, I might be able to help with the creation of the property path to reference the attached property… if you could provide additional details on how you tried… as a workaround to the problem cited above.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 651 views)

    User (Old forums)
    Post count: 23064

    I found a way around the problem by specifying an invisible column containing the attached property:

    <xcdg:Column FieldName=”Group” Title=”Group” ReadOnly=”True”
    DisplayMemberBinding=”{Binding Path=(local:GroupHelper.Group)}” Visible=”False”>

    This column’s DisplayMemberBinding can then be used to add the GroupDescription:

    cv.GroupDescriptions.Add(new PropertyGroupDescription(“(local:GroupHelper.Group)”, converter));

    Not very intuitive, but it does the job

    Imported from legacy forums. Posted by Nelis (had 3397 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.