views:

41

answers:

0

I have a UserControl that contains a DataGrid. This form is being inherited many times and I'm finding that most of the time I want to sort the grid when the data source changes. I would like to have two properties in the base class for the default sort column and direction and have these show in the designer. The sort direction is easy because it's an enum but I haven't figured out how to be able to choose a column. I'm trying to use a UITypeEditor but it needs access to the data grid in order to populate the columns to choose from.

Is there a way to choose a column from the data grid in the designer and implement this in the base class when it doesn't know yet what columns will be in the data grid?