The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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
Hi Andy,
Thanks for contacting Syncfusion support. SfDataGrid supports hiding and unhiding of columns from the 2017 Volume 1 Main Release ( version 15.1.0.33) . Please refer the following code snippet to achieve your requirement.
// Hide a colum
this.dataGrid.Columns[0].IsHidden = true;
GridTextColumn column = newGridTextColumn();
column.IsHidden = true;
//UnHide a column
this.dataGrid.Columns[0].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[0].IsHidden = true; should be enough ti give us the desired result.
Thanks.
KKKarthikraja Kalaimani Syncfusion Team May 3, 2021 01:19 PM UTC
Hi Jonathan,
The direct IsHidden property implemented for MVVM pattern and DataGrid.Columns[0].IsHidden is implemented for C# based architecture. So, we can use based on the architecture.