Home Forums WPF controls Xceed DataGrid for WPF ITypedList and nested properties

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #24438 |

    Hi

    I am binding to a list that supports ITypedList

    I would like the column headings displayed to be based on the System.ComponetModel.DisplayNameAttribute

    For direct properties this is working
    For properties within another property on the object I can’t get this working.

    I have tried using both a DataGridCollectionView and DataGridCollectionViewSource but cannot get either to display the coulumn bound to the DisplayNameAttribute

    I have also tested adding the nested property into the result of GetItemProperties.
    This causes the column to display when using the DataGridCollectionView, but without the content.
    e.g with property Test on Property Nested

    result.Add(orignal[“Nested”]);
    PropertyDescriptor test = orignal[“Nested”];
    PropertyDescriptor pd = TypeDescriptor.GetProperties(test.PropertyType)[“Test”];
    result.Add(pd);

    Adding an extra column with a path directed to the nested property will display the property, but not the correct heading.

    Is this possible to do?
    Ideally I would a solution that is xaml based.

    Thanks in advance
    Nigel

    Imported from legacy forums. Posted by Nigel (had 542 views)

    Xceed Support
    Member
    Post count: 5658

    This may be related to the fact that when using the DataGridCollectionView[Source] the items are System.Data.DataRow objects and not DataRowViews. This said, you can add the column manually, like you are doing, and then set the column’s Title property to display the heading you would like.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 2897 views)

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