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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get grid column order programatically

Thread ID:

Created:

Updated:

Platform:

Replies:

147922 Sep 27,2019 03:58 PM UTC Sep 30,2019 05:41 AM UTC Blazor 2
loading
Tags: Grid
Paul Skelton
Asked On September 27, 2019 03:58 PM UTC

I have a grid that allows drag and drop reordering of the columns. I'd like to get the new order of columns so I can save and the next time the grid is displayed I can order the columns the same way. In addition, how do I know when the user has re-ordered columns? Is there an event I can hook into?

Thanks!

Paul Skelton
Replied On September 27, 2019 04:39 PM UTC

I answered my own question...

 <GridEvents OnActionComplete="ActionCompletedHandler" TValue="DocShim"></GridEvents>


    public async void ActionCompletedHandler(ActionEventArgs<DocShim> args)
    {
        if (args.RequestType == Syncfusion.EJ2.Blazor.Grids.Action.Reorder)
        {
            // This will contain the new column order
            var cols = await grid.GetColumns();
        }
    }


Vignesh Natarajan [Syncfusion]
Replied On September 30, 2019 05:41 AM UTC

Hi Paul,  

Thanks for contacting Syncfusion support.  

Query: “ In addition, how do I know when the user has re-ordered columns? Is there an event I can hook into? && I answered my own question... 
 
We are glad to hear that you have resolved the query on your own. Yes you can use OnActionComplete event and GetColumns() method to achieve your requirement. This (OnActionComplete) event will be triggered whenever certain action like paging, reorder, filtering, sorting, etc. get completed. 

Refer our UG documentation for the list of events support in EjsGrid along with API reference.  



Please get back to us if you have further queries.   

Regards, 
Vignesh Natarajan.  


CONFIRMATION

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

Live Chat Icon For mobile
Live Chat Icon