Date column created in ASPOSE is giving wrong value while sorting

Hi Team,
In my code i am trying to download a column as date using the following code .When file get downloaded the particular column data type 
is shown as date but while sorting it on asc or dec order it is sorting based on first two number
and not as date can you help me to fix this issue.

Aspose.Cells.Style cstyle = null;

StyleFlag style = new StyleFlag();
switch (dbColumn.ColumnName)
{
case “StartDate”:
cstyle = this.ExcelWorkBook.Styles[this.ExcelWorkBook.Styles.Add()];
cstyle.Number = 14;
style.NumberFormat = true;
style.All = true;
break;
}
if (cstyle != null)
{
Aspose.Cells.Range colRange = cells.CreateRange(startTblRowIndex + 1, i, table.Rows.Count, 1);
colRange.ApplyStyle(cstyle, style);
}



Hi,


Thanks for providing us some details with sample code segment.

We are not entirely certain about your issue. Could you elaborate it more and create a simple console (runnable) application (you may zip it prior attaching here) with your template file (if any) to reproduce the issue on our end. Also, do you sort data in MS Excel manually for the output Excel file (by Aspose.Cells APIs). How do you sort data, show some screen shots or steps involved? Please use dynamic dataset/datatable in your code to remove any inter dependencies for external data source or database, so we could evaluate and run your test project fine. Moreover, please attach your expected Excel file (with your sorted data), you may use MS Excel to sort your data using data sorting feature (Sort) of MS Excel (give steps how do you use the option), it will help us really to evaluate your issue precisely and we can guide you better to figure out your issue soon.

By the way, why you are creating so many ranges as per your following lines of code:
e.g
Sample code:

Aspose.Cells.Range colRange = cells.CreateRange(startTblRowIndex + 1, i, table.Rows.Count, 1);
 colRange.ApplyStyle(cstyle, style);
Instead, I think you may create your desired range (based on your whole desired area) once at the end to apply your desired formatting to the range cells.

Thank you.