I am developing an application and using the VS2008 DataGridView control.
I have a bound DataGridView using a binding source etc.
I need to provide sorting within the DataGridView control on a column using the ‘Display Value’ of the cells rather than the value from the bound datasource.
The column uses a ComboBox that references a lookup table to get the ‘Display value’, it is this Display Value I need the user to be able to sort the datagrid on.
With AutoSort turned on it sorts on the cell value data rather than the 'Display Value' which is meaningless to the user.
Eg., the cell value (combobox) is the 'employee_id' from the bound datasource whilst the display value being the 'employee name' from a lookup table i.e., the employee table.
This seems like a fairly standard requirement for many applications. Can anyone advise if this is possible and how this can be achieved.
Regards Kieran
I have a bound DataGridView using a binding source etc.
I need to provide sorting within the DataGridView control on a column using the ‘Display Value’ of the cells rather than the value from the bound datasource.
The column uses a ComboBox that references a lookup table to get the ‘Display value’, it is this Display Value I need the user to be able to sort the datagrid on.
With AutoSort turned on it sorts on the cell value data rather than the 'Display Value' which is meaningless to the user.
Eg., the cell value (combobox) is the 'employee_id' from the bound datasource whilst the display value being the 'employee name' from a lookup table i.e., the employee table.
This seems like a fairly standard requirement for many applications. Can anyone advise if this is possible and how this can be achieved.
Regards Kieran