We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to apply sorting property

Thread ID:





125717 Sep 6,2016 08:47 AM UTC Sep 8,2016 02:03 PM UTC UWP 3
Tags: XlsIO
Sharad Kumar
Asked On September 6, 2016 08:47 AM UTC


How to apply sorting in Excel file using Syncfusion xlsio engine.
I have attached the included excel sorting file.

ExcelEngine oengine = new ExcelEngine();
IApplication oApp = oengine.Excel;
oApp.DefaultVersion = ExcelVersion.Excel2007;
IWorkbook oWorkbook  =  oApp.Workbooks.Create(1);
IWorksheets osheets = oWorkbook.Worksheets;
IWorksheet  osheet = osheets .Worksheets[0];

IDataSort sorter = oWorkbook .CreateDataSorter();
1) First file related code

sorter.SortRange = osheets.Range["D1:D26"];
sortField = sorter.SortFields.Add(4, SortOn.Values, OrderBy.Descending);
sorter.Algorithm = SortingAlgorithms.QuickSort;    

2) Second file related code

sorter.SortRange = osheets.Range["E2:E10"];
 sortField = sorter.SortFields.Add(oRange2007.Column, SortOn.CellColor, OrderBy.OnBottom);
 sortField.Color = Windows.UI.Color.FromArgb(0, 255, 0, 0);

This code is run successfully create sorting property . but In first file ascending/descending order is not set. and second file cell color color value is not set.

sharad kumar

Attachment: New_folder_(7)_af2396e0.rar

Sridhar Sukumar [Syncfusion]
Replied On September 7, 2016 04:57 PM UTC

Hi Sharad, 
Thank you for contacting Syncfusion support. 
We have analyzed you code and found that you are trying to sort single column data. When applying sorting for single column, we have found an issue “Sorting is not applied to single column data”. So please confirm us whether you have faced the same issue in your side. if no, kindly share us the detailed information of the issue you have faced in your side. 
Sridhar S 

Sharad Kumar
Replied On September 8, 2016 03:02 AM UTC


I am applied sorting for single column.
My code successfully create sorting property but Ascending/descending order is not set.

Similarly in Top10 AutoFilter property percent value is not.


Sridhar Sukumar [Syncfusion]
Replied On September 8, 2016 02:03 PM UTC

Hi Sharad, 


Thank you for updating us. 


We were able to reproduce the problem and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates 




Please let me know if you have any questions. 



Sridhar S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon