The idea was to make datagrid control as dumb as possible. Adhering to MVP (Model-View-Presenter) I wanted the presenter to specify the column definition for the view. Another objective was to allow user to bind same Model data to different views. Thus the
way I achieved for other collection controls ListBox, Listview, etc was to specify the control definition as DataTemplate and set it to ItemTemplate f the control.
But doing the same with WPF datagrid was not working, thus I created a custom DataGrid control inheriting from WPF DataGrid and hide "Columns" (type: ObservableCollection<DataGridColumn>) by creating dependency property of the same.
Now the presenter specifies the DataGridColumn collection and binds to "Columns" property of the custom control (view). The view then manually add's the columns to DataGrid control.
I am very eager to know whether the approach I have followed is correct or not.
Is there another better/nice/optimum way to achieve the above?