How to add custom property to WPF DataGridColumn
I want to create custom class that inherits from DataGridColumn and add custom property to it. Than I want to create class that inherits DataGrid which will always use this custom开发者_如何转开发 column types. For example: If user adds DataGridTextColumn it should have custom properties available.
I managed to inherit from DataGridColumn and use that class later, but I don't know how to make that column type default (base) for any column my custom DataGrid will use.
I am using C# and .NET Framework 4.0.
Thanks in advance,
Valentino
What I did was to download the WPF Toolkit - http://wpf.codeplex.com/. I upgraded the projects to .NET 4 and made my modifications there.
Otherwise if you can't just inherit from DataGridColumn, then have a look at AttachedProperties in WPF.
精彩评论