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.
ADAdministrator Syncfusion Team January 31, 2007 12:03 AM UTC
In a GridControl or GridDataBoundGrid, you can you code like: grid.Model.Cols.Hidden[colIndex] = true;
to hide a column.
In a GridGroupingControl, you use code like: grid.TableDescriptor.VisibleColumns.Remove("columnName");
ADAdministrator Syncfusion Team February 1, 2007 12:01 PM UTC
Thanks for details...
Actually i want 2 functionalities hide columns and delete columns from the grid... User can unhide the earlier hiden column but should not get deleted column back....
How to achieve these 2 functionalities and unhide the column
ADAdministrator Syncfusion Team February 1, 2007 07:01 PM UTC
Hi,
Issue 1: Hide/Unhide the column:
In a GridControl or GridDataBoundGrid, A column can be hidden or unhidden by just setting the this.gridControl1.Cols.Hidden[colIndex] = true; and this.gridControl1.Cols.Hidden[colIndex] = false; respectively.
In a GridGroupingControl, you use the VisibleColumns property of the GridTableDescriptor to show / hide the columns in the grid. Below is a code snippet
//For hide the "Col0" column this.grid.TableDescriptor.VisibleColumns.Remove("Col0");
//For show the "Col0" column this.grid.TableDescriptor.VisibleColumns.Add("Col0");
Issue 2: Remove the column from the grid.
In a GridControl, the column can be removed by calling the gridControl1.Model.Cols.RemoveRange(from,to);
In a GridDataBoundGrid or GridGroupingControl, column can be removed by using the underlying datasource of the grid. Here is a code.
DataTable dt = grid.DataSource as DataTable; dt.Columns.Remove("Col1"); dt.AcceptChanges();