WPF DataGrid on CustomControl
Hi, I need some help in WPF/XAML
I have a UserControl for a PaginatesTable where I have a couple of WPF controls inside, TextBox, DataGrid, and some buttons for pagination, the main idea of the UserControl is to be reusable, so basically I have some PaginatedTableViewModel<T> which I initialize on each ViewModel of the Views and then I pass an ObservableCollection into PaginatedTableViewModel<T> to render those Objects
But I need an approach to customize the DataGrid columns, Because obviously there are different properties on <T>
Probably I want to do something like
<PaginatedTable DataContext={Binding PaginatedTableViewModel}>
<PaginatedTable.Columns>
<!-- Customization of Columns —>
</PaginatedTable.Columns>
</PaginatedTable>
I tried with DependencyProperty but I was not able tu make it reusable
1 Reply
Have you solved it ?