Hello Madam/ Sir,
I am facing some weird issue regarding the Syncfusion Grid columns. I will explain briefly on below,
1) I have one grid table having 7 columns and one Multiselect dropdown that contains the column names of grid table with checkboxes.
2) I want to hide/show column as per the column selection in dropdown.
3) I am keeping the history of checked/unchecked columns using localstorage, it means whenever user select/unselect the value from dropdown, value of that variable is storing in localstorage & whenever user revisit the page I am extracted values from localstorage and applying to columns to hide/show.
4) The main problem is, I got the value correctly from localstorage but it is not reflecting to Grid template or grid html. Please check the below code.
// For storing value to localstorage when ever user check/uncheck the columns,
localStorage.setItem('column1', JSON.stringify(true));
// Getting value from localstorage
let columnOne = JSON.parse(localStorage.getItem('column1'));
// Now applying the value to Grid, it is not reflecting
{{ columnOne }} <!-- It showing here columnOne value correctly but not in below -->
<ejs-grid #dataSourceGrid [dataSource]='testDataSource' allowSorting='true'>
<e-columns>
<e-column field='column1' headerText='Column 1' width='70' [allowSorting]='true'
*ngIf="columnOne">
</e-column>
5)After the selection/de-selection process of columns, values are getting correctly but not reflecting to Grid columns.
6) When user deselect the column name, column get false and it has hidden. Next time when user select the value of respective column it is showing true value but not showing the column which is hidden by *ngIf.
7) I think the boolean value is not properly rendering to Grid system.
Please note: I haven't provided any code or any function calls regarding this. Please check the above and if you required the code regarding the scenario, I will generate some demo example on "StackzBlitz" and let you know.
Thanks & Regards,
Siddharth