- Welcome, Guest. Please Login or Register
  We have released initial version of MindFusion.JavaScript pack. It includes chart, diagram, calendar, map, virtual keyboard, gauge and UI components. Here are more details and live demo for anyone interested.  
Page Index Toggle Pages: 1 Send Topic Print  
Alphabetical Column Ordering User Side
Read 446 times

MindFusionUser47   Offline
YaBB Newbies
Posts: 7
Gender: male
I Love MindFusion!

Alphabetical Column Ordering User Side
Feb 1st, 2018 at 11:35pm
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.
IP Logged    

Meppy   Offline
YaBB Moderator
Posts: 1783
Gender: male
MindFusion support

Re: Alphabetical Column Ordering User Side
Reply #1 - Feb 2nd, 2018 at 8:48am

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:

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.

IP Logged    
Page Index Toggle Pages: 1 Send Topic Print