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. Image for the cookie policy date

Display Order of Group Items in DropDownList

Sir, how do I set the order in which the group items are displayed in the drop down list.

From the image below. How can I set the group heading 'Beans' to appear before' Leafy And Salad.

I can not work out how your algorithm determines the grouping order. It is not alphabetical.  All I an trying to achieve is as a "Common" group and and a 'Infrequent' group, so that of a list of 50 items, the most commonly selected ~ 8 items are shown first. But no matter what alphabetical labels I give them, your algorithm always seems to display the largest group 'Infrequant' first in the list.




1 Reply

SN Sevvandhi Nagulan Syncfusion Team November 25, 2019 05:25 AM UTC

Hi James, 

Greetings from Syncfusion support. 

We would like to inform you that, the grouping header will be created as per the data given in the dataSource. You can use the sortOrder property to sort the header whether in ascending or desending. Please refer the code snippet, 

[app.component.html] 
<ejs-dropdownlist #grouping id='vegetables' [dataSource]='vegetableData' [placeholder]='groupWaterMark' [fields]='groupFields' [popupHeight]='height' [sortOrder]='sort'></ejs-dropdownlist> 

[app.component.ts] 
public sort: string = 'Ascending'; 


Regards, 
Sevvandhi N 


Loader.
Live Chat Icon For mobile
Up arrow icon