This sample illustrates Essential Grid’s support for foreign-key combo boxes in grid cells. This sample also implements a solution for sorting a column by its display member instead of the value member of the column.
Features:
Default sorting done in a GridDataBoundGrid using the IBindingList.Sort method on the underlying data source of the grid.
Thus, the sorting is done on the actual values in the data source and not the foreign-key value obtained from another data source.
When the data source is a data table, then sorting is performed by setting the DataView.Sort property on the DataTable.DefaultView.
The CellClick event and QueryCellInfo event handlers are used for this purpose.
In the CellClick event, for the drop-down columns, the display member is set as sort name by which the grid is sorted.
The data view is created by using the List property of currency manager.
The data view sort is applied with a sort name, which holds the column name by which grid is sorted.
The QueryCellInfo handlers' sorting icon is drawn with respect to sorting.