In the DataGrid, I use AllowResizing, AllowReordering and EnablePersistence. How can I set default values for column order and column width for the first time when the user runs the page?
Based on your query, we suspect you want clear persistence when grid is created. We have ResetPersistDataAsync used inside the grid created event. Please refer the code snippet and documentation for more information.
public void CreatedHandler(object args)
Documentation ; https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Grids.SfGrid-1.html#Syncfusion_Blazor_Grids_SfGrid_1_ResetPersistDataAsync
Please let us know if you have any concerns.
I don't want to reset all user settings. Suppose we have columns A, B, C, D. I hide column C by default in the source code. The first time the user opens the page, there is a hidden C that can be removed from the hidden state. The next time the user opens the page, I want the same settings that the user set last time to be displayed, and I don't want to reset the settings.
I want the following items to be removed from the data grid settings on page load:
Thanks for the patience.
Query: “I want the following items to be removed from the data grid settings on page load”
Yes we can achieve your requirement by clearing the unwanted settings in the persist properties and we suggest you to set new properties in Grid settings.
We have discussed the similar query on the below tread. So kindly refer the attached thread for your reference.
Also please find the attached sample using latest Nuget version for additional information and let us know if you face any difficulties.