UNHIDE ALL COLUMNS WITH CODING

Hi,

Any option to Unhide All Columns in GridGrouping Control with commands, as we are unabe to find in columns which columns are hidden after which column
Please suggest me for the same

Thanks
Deepak



1 Reply

MG Mohanraj Gunasekaran Syncfusion Team July 18, 2018 07:27 AM UTC

 Hi Deepak, 
 
Thanks for using Syncfusion product. 
 
Suggestion1 
 
By default, you can hide the columns by using VisibleColumns property and actual columns are maintaining in Columns(GridColumnDescriptorCollection). So, you can identify those hidden columns by iterating the GridColumnDescriptorCollection. Please refer to the below code example, 
 
Code example 
//To hide the columns 
this.gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("Ship City"); 
this.gridGroupingControl1.TableDescriptor.VisibleColumns.Remove("Ship Country"); 
 
foreach (var column in this.gridGroupingControl1.TableDescriptor.Columns) 
{ 
    //To unhide the columns 
    if (!this.gridGroupingControl1.TableDescriptor.VisibleColumns.Contains(column.Name)) 
        this.gridGroupingControl1.TableDescriptor.VisibleColumns.Add(column.Name); 
} 
 
 
 
Please refer to the below UG and KB link, 
 
 
Suggestion2 
If you hide the column by resizing at run time, column width will be getting 0. So, you can find those hidden columns by checking the Column.Width property. Please refer to the below code example, 
 
Code example 
foreach (var column in this.gridGroupingControl1.TableDescriptor.Columns) 
{ 
     if (column.Width == 0) 
        column.Width = this.gridGroupingControl1.TableControl.DefaultColWidth; 
} 
 
 
 
Sample link: GridGroupingControl 

Please let us know if you are using different approach to hide the column in GridGroupingControl. 
 
Regards, 
Mohanraj G 
 


Loader.
Up arrow icon