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

Syntax for sorted-colums tag

I'm trying to set the default sorting. I know I need to add

<e-sort-settings sorted-columns="????" />

where the razor version would have been

.SortSettings(sort => sort.SortedColumns(col => col.Field("Name").Direction(SortOrder.Ascending).Add()))

What's the syntax for the tag helper version?

2 Replies

RB R Brian Lindahl April 14, 2017 12:39 AM UTC

Figured out to use <e-sorted-columns> instead. Needs better documentation, like a lot of Core does.


MS Mani Sankar Durai Syncfusion Team April 14, 2017 10:25 AM UTC

Hi Brian 

Thanks for contacting Syncfusion support. 

We have analyzed your query and we can perform the sorted columns using tag helper based on the following way. 
Refer the code example 
<ej-grid id="Grid" datasource=ViewBag.datasource allow-paging="true" allow-sorting="true" allow-multi-sorting="true" > 
   <e-sort-settings> 
        <e-sorted-columns> 
            <e-sorted-column field="CustomerID" direction="Ascending" /> 
            <e-sorted-column field="Freight" direction="Ascending" /> 
        </e-sorted-columns> 
    </e-sort-settings> 
 
   <e-columns> 
... 
  </e-columns> 
</ej-grid> 
 

Also based on your suggestion we will complete the document and let you know once we refreshed online. 

Please let us know if you need further assistance. 

Regards, 
Manisankar Durai. 


Loader.
Up arrow icon