Hi, i need to hide and show a column in a Datagrid in Xamarin Forms. For hide i use the sentence dataGrid.Columns["name"].Width = 0 , but when it shows, not working when assign a value mayor that 0 and I can't show more the column.
VPVimal Prabhu Manohkaran Syncfusion Team March 14, 2017 04:10 AM UTC
Thanks for contacting Syncfusion support. SfDataGrid supports hiding and unhiding of columns from the 2017 Volume 1 Main Release ( version 184.108.40.206) . Please refer the following code snippet to achieve your requirement.
// Hide a colum
this.dataGrid.Columns.IsHidden = true;
GridTextColumn column = newGridTextColumn();
column.IsHidden = true;
//UnHide a column
this.dataGrid.Columns.IsHidden = false;
column.IsHidden = false;
Regards, Vimal Prabhu
JIJonathan IsmailaMay 2, 2021 04:31 PM UTC
Why duplicating codes that mean same?
Syncfusion should eliminate the second command as it is unnecessary.
this.grid.Columns.IsHidden = true; should be enough ti give us the desired result.
KKKarthikraja Kalaimani Syncfusion Team May 3, 2021 01:19 PM UTC
The direct IsHidden property implemented for MVVM pattern and DataGrid.Columns.IsHidden is implemented for C# based architecture. So, we can use based on the architecture.