public class CustomSortComparer : IComparer
{
public int Compare(object x, object y)
{
double xConvert = Convert.ToDouble(x.ToString());
double yConvert = Convert.ToDouble(y.ToString());
return Convert.ToInt32(xConvert - yConvert);
}
}
gcSpreadSheet1.Sheets[0].SetText(0, 0, "1");
gcSpreadSheet1.Sheets[0].SetText(1, 0, "10");
gcSpreadSheet1.Sheets[0].SetText(2, 0, "2");
gcSpreadSheet1.Sheets[0].SetText(3, 0, "20");
gcSpreadSheet1.Sheets[0].SetText(4, 0, "3");
gcSpreadSheet1.Sheets[0].SetText(5, 0, "30");
gcSpreadSheet1.Sheets[0].SortRange(0, 0, 6, 1, true, new SortInfo[] { new SortInfo(0, false,new CustomSortComparer()) });
gcSpreadSheet1.Invalidate();