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)
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)