change column order dynamically

Hi.

How can I change the column order dynamically in a sfgrid?

Basically, I want allow the user resize and reorder the columns and save the layout to be used every time he login. 


Thank you

Leo




3 Replies

RN Rahul Narayanasamy Syncfusion Team August 10, 2021 12:59 PM UTC

Hi Leo, 

Greetings from Syncfusion. 

Query: How can I change the column order dynamically in a sfgrid? 

We have validated your query and you want to change the column order dynamically. You can achieve your requirement by using Column reordering feature. Reordering can be done by drag and drop of a particular column header from one index to another index within the DataGrid. To enable reordering, set the AllowReordering property to true. Find the below documentation for your reference. 

Reference

Query: Basically, I want allow the user resize and reorder the columns and save the layout to be used every time he login. 

You want to save the state of the Grid and restore the state next time while loading the page. If yes, you can achieve your requirement by enabling the persistence(EnablePersistence). Find the below documentation for your reference. 

Reference

Please let us know if you have any concerns. 

Regards, 
Rahul 



LR Leo Ramos August 11, 2021 01:45 PM UTC

I got it.


Thank you.




RN Rahul Narayanasamy Syncfusion Team August 12, 2021 05:03 AM UTC

Hi Leo, 

Thanks for the update. 

We are happy to hear that the provided solution was helpful for your requirement. Please get back to us if you need further assistance. 

Regards, 
Rahul  


Loader.
Up arrow icon