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 is sort order handled?

Thread ID:





130231 Apr 30,2017 12:55 PM UTC May 1,2017 12:14 PM UTC ASP.NET Web Forms 1
Tags: TreeView
Armand De Lange
Asked On April 30, 2017 12:55 PM UTC


I want to sort nodes by a separate integer sort order field in die database, how can it be done?

What data field is used to handle sort in the treeview object?


Karthik Ravichandran [Syncfusion]
Replied On May 1, 2017 12:14 PM UTC

Hi Armand, 
Thanks for contacting Syncfusion support. 
We have checked your query (“How is sort order handled”). You can achieve your requirement by using sortSettings API in ejTreeView.  you can sort the treenodes node by its node text Please refer the below code snippet. 
    fields: { id: "id", parentId: "pid", text: "name", hasChild: "hasChild", dataSource: localData, expanded: "expanded" }, sortSettings: { 
        allowSorting: true, 
        sortOrder: ej.sortOrder.Ascending 
To achieve this with your custom field, you should map the custom field as a node Text. 
For your convenience, we have attached the sample below, 
To know more details about ejTreeView, please refer the below documentation link. 
Please let us know if you need further assistance on this. 
Karthik R 


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

This page will automatically be redirected to the 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