Within my DataGridView control, the user could edit and fill the cells with any value and with any type (e.g. one cell is integer the other is string and so on). However, when the user click the header cell of that column that containing multiple types of object trying to sort it, I get the following exception:
Object must be of type Int16, or
Object must be of type string, .. (depends on the first cell value)
How to avoid this problem?