Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Alphabetical Column Ordering User Side (Read 739 times)
MindFusionUser47
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 9
Location: Illinois
Joined: Jan 23rd, 2018
Alphabetical Column Ordering User Side
Feb 1st, 2018 at 11:35pm
Print Post  
Hi,
How would I go about adding alphabetical column ordering A-Z or Z-A based off a user column click. A click on header column one would reorder column one so that all its rows are in alphabetical order A-Z. A second click would do Z-A. Also I need to keep the rows in order for all columns such that for each row reorder all the rows columns would move. This is so the rows always stay together and data doesn't get mixed up. Make Sense? So is there a built in method? Or will i have to implement it? What are my best options? If you need to know further of what is required let me know.
Thanks,
Jacob
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Alphabetical Column Ordering User Side
Reply #1 - Feb 2nd, 2018 at 8:48am
Print Post  
Hi,

It is possible to sort a range of cells by particular column without mixing up data, that is, the data inside individual rows remains intact when the rows are sorted. However, you currently cannot detect clicks on worksheet headers, so it is not possible to execute the sorting in response to the user clicking on a header.

Here is the code that illustrates how you can sort a range of cells by a specific column:

Code
Select All
var options = new SortOptions();
options.Keys.Add(new SortKey(0));
worksheet.Sort(worksheet.CellRanges["A1:B4"], options); 


The above code sorts the cells in the range A1:B4 of worksheet worksheet by the first column (column A).

Let me know if this helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint