FIELD CHOOSER TO SHOW / HIDE FIELDS RECORD IN SFDATAGRID

How I can select Field Chooser like option in Grid Grouping Control, so that we can Select the Field to show/hide and as per the same we can export to pdf/excel..

If Field is selected as Hidden field, then the same field will not export to pdf/excel format.

The Hidden Field can again show in the SFDataGrid also.

In short as per Grid Grouping control, the same requirement is here.. how Can do that ?

Thanks
Deepak

4 Replies

NK Neelakandan Kannan Syncfusion Team August 13, 2018 10:22 AM UTC

Hi Deepak, 
 
Thanks for contacting Syncfusion support. 
 
How I can select Field Chooser like option in Grid Grouping Control, so that we can Select the Field to show/hide and as per the same we can export to pdf/excel.. 
Currently SfDataGrid control does not have support for the Column chooser. We have added this feature to our feature request list. This will be available in our upcoming 2018 Volume 3 release which is expected to be rolled out in Mid of September (2018). 
If Field is selected as Hidden field, then the same field will not export to pdf/excel format. 
The hidden columns from the column chooser will be exported by default. The hidden columns should be added to the Exclude property of PdfExportingOptions and ExcelExportingOptions.  
 
We have provided the UG for excluding the columns from exporting. Please refer the below UG, 
 
Code example 
Excel exporting 
ExcelExportingOptions options = new ExcelExportingOptions(); 
foreach (var columns in sfDataGrid1.Columns) 
{ 
if (!columns.Visible) 
options.ExcludeColumns.Add(columns.MappingName); 
}  
var document = sfDataGrid1.ExportToPdf(sfDataGrid.View, options); 
 
PDF exporting 
PdfExportingOptions options = new PdfExportingOptions(); 
foreach (var columns in sfDataGrid1.Columns) 
{ 
if (!columns.Visible) 
options.ExcludeColumns.Add(columns.MappingName); 
}  
var document = sfDataGrid1.ExportToPdf(options); 
 
 
Regards, 
Neelakandan 



AA Arulraj A Syncfusion Team September 18, 2018 10:17 AM UTC

 
We are glad to announce that our v16.3.0.17 beta release is rolled out, we have added the feature “Column chooser support in SfDataGrid” and it is available for download under the following link.  
   
  
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Arulraj A 



DE Deepak September 18, 2018 02:04 PM UTC

Please send me Commands for the same

also request to send me the users guidelines for version 16.3.0.17 for Winforms All controls

Thanks
Deepak


AA Arulraj A Syncfusion Team September 19, 2018 07:27 AM UTC

Hi Deepak, 

Thanks for your update. 

You can make use of ColumnChooserPopup or ColumnChooser control to change the visibility of the columns in SfDataGrid at runtime. Please refer to the following code example and sample from the given location. 

Code Example :  

//Attach the column chooser popup to the sfdatagrid. 
ColumnChooserPopup columnChooserPopup = new Syncfusion.WinForms.DataGrid.Interactivity.ColumnChooserPopup(sfDataGrid); 
columnChooserPopup.Show(); 
 
 
// Add column chooser as control 
ColumnChooser columnChooser = new Syncfusion.WinForms.DataGrid.Interactivity.ColumnChooser(this.sfDataGrid); 
columnChooser.Location = new Point(780, 120); 
this.Controls.Add(columnChooser); 


At present, the user guidelines for the features included in the version 16.3.0.17 were not published in our help documentation. It will be published in the end of September 2018. 

Please let us know if you need any further assistance on this. 

Arulraj A 


Loader.
Up arrow icon