Click here to Skip to main content
15,890,579 members
Articles / Desktop Programming / WPF

How to Auto-generate Multiple Custom Columns in a WPF DataGrid for Same Type Properties

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
1 Apr 2020CPOL2 min read 12.6K   124   6  
A generic workaround for auto-generating multiple custom columns in a WPF DataGrid in case where the data class has multiple properties of the same type
Auto-generating multiple custom columns in a WPF DataGrid in case where the data class has multiple properties of the same type doesn’t work like one would have expected because the custom control’s data context is not the property one intends to bind to, but the containing instance. So, the custom control or its view model doesn't know to which of the same-type properties to bind.

Views

Daily Counts

Downloads

Weekly Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Vassili Kravtchenko-Berejnoi Technical Computing
Austria Austria
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions