DataGridView: Override AutoGenerateColumns logic
Posted on 2014-03-14
I'm working on a custom DataGridView control because I want to create a couple new column types, This is used as part of a debugging and diagnostic tool so I have no idea what the resulting datatables that will be bound to the DataGridView will be at run time.
I think the best way to do this is to override the logic that creates those columns when the datasource is assigned to the control. I just haven't been able to find any examples of how to pull this off.
I have a feeling I need to override the OnDataBindingComplete or OnDataSourceChanged methods but I'm not sure if I'm on the right track and where to start.