Here is my issue:
I have a datagrid that is populated with a datatable. I want the
columns of the datagrid to be sortable. I also want to format the
numeric columns such as two decimal places or three, etc. The trick
to this, is that String.Format offers powerful formatting
functionality, so this seems like an obvious choice. BUT- strings do
not sort well in a datagrid (using the .sort property of a dataview
object and then binding to the datagrid) You end up with sorted data
like:
10
12
2
21
4
52
instead of
2
4
10
12
21
52
The only way to get the numbers to sort correctly is to set the
datatype of the datagrid column to a numeric type (i.e. int or
double), but then I loose my formatting.