M
Mike
I'm passing a number to a datagrid but when I sort on that column its
sorting it as a string, not a number. eg 100 comes before 2.
eg
//Get Key from an array of objects
.....
dr["Instrument Key"] = System.Convert.ToDecimal(RatesArray[i,4]);
.....
DataGridTextBoxColumn instrumentKeyColumn = new
DataGridTextBoxColumn();
instrumentKeyColumn.MappingName="Instrument Key";
instrumentKeyColumn.HeaderText = "Instrument Key";
instrumentKeyColumn.Width = 80;
instrumentKeyColumn.Alignment = HorizontalAlignment.Right;
//instrumentKeyColumn.Format="n0";
dgts.GridColumnStyles.Add(instrumentKeyColumn);
.....
Any idea what I'm doing wrong?
sorting it as a string, not a number. eg 100 comes before 2.
eg
//Get Key from an array of objects
.....
dr["Instrument Key"] = System.Convert.ToDecimal(RatesArray[i,4]);
.....
DataGridTextBoxColumn instrumentKeyColumn = new
DataGridTextBoxColumn();
instrumentKeyColumn.MappingName="Instrument Key";
instrumentKeyColumn.HeaderText = "Instrument Key";
instrumentKeyColumn.Width = 80;
instrumentKeyColumn.Alignment = HorizontalAlignment.Right;
//instrumentKeyColumn.Format="n0";
dgts.GridColumnStyles.Add(instrumentKeyColumn);
.....
Any idea what I'm doing wrong?