239
Views
3
Comments
Solved
[OutSystems Data Grid] How to reset the layout of the grid?
Question
outsystems-data-grid
Reactive icon
Forge asset by OutSystems

Hi,

There is currently the option to apply saved grid layouts to the grid. Is there a way to reset the grid layout?
I tried by calling SetViewLayout with an empty Config parameter. But that does not work.

Regards,
Alfio Esposito

2022-09-16 08-04-04
Bruno Martinho
Staff
Solution

Hello @Alfio Esposito ,

The Grid layout is the definition that the wijmo Flexgrid understands to display the columns in that desired way, so sending empty won't do the trick.

My suggestion is to store the JSON generated (using the GetViewLayout) when you have the grid in the status to where you want to reset it (you can use the Grid event OnInitialize) and then use that JSON when you want to "Reset" the layout (using SetViewLayout).

I'm not totally sure that this can work for your use case, so let us know if this helps,

Thanks,

Bruno Martinho 


2019-05-02 11-42-50
Alfio Esposito

Thank you for your quick response and for the suggestion Bruno. This works for our use case.

Regards,
Alfio

2021-04-17 10-20-07
Sugu

Hi Bruno,

If you could provide an example implementation would be very helpful for me as i'm stuck with using "SetViewLayout" for grid reset. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.