Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Display specific object properties in a DataGridRow

$
0
0

Hello,

In my application, i have 10 properties for a class (Class: Employee). I have a ObservableCollection<Employee> which i am binding to a DataGrid.

I want to display only 5 properties from this class in the DataGrid but the solution should be a generic solution. I mean, in future if other class needs to be binded to DataGrid then the code should not be changed.

Can i use custom attributes to get list of available properties which needs to be displayed or is there any other better way? If yes how can i use this in by application where i just have to pass the class and it will return the properties which i can display in DataGrid?

Thanks in adavance.

Regards,

IamHuM



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>