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.
I am using GridDataBoundGrid to display data and I need hide some columns to user. But when I print this datagrid, all hidden columns are lost.
I would like to print all columns in the grid whether It is hidden or not.
Please let to me know how to print all columns if have some column are hidden.
Thanks,
Hoang
ADAdministrator Syncfusion Team June 15, 2005 09:13 AM UTC
If you hide the columns by setting their widths=0, then you can handle the grid.Model.QueryColWidth event and conditionally set the width to show them if you are printing. Here is a sample.
http://www.syncfusion.com/Support/user/uploads/GDBG_PrintHidden_d33a1a91.zip
HDHoang DinhJune 16, 2005 02:33 AM UTC
Thank for your help. And now, I can print all colums in the datagrid. But I see another issue.
The screen flash some colums when I show the datagrid.
Ex:
this.dataGrid.DataSource = dt;
this.dataGrid.Model.ColWidths["Col0"]=0;
this.dataGrid.Model.ColWidths["Col1"]=0;
this.dataGrid.Model.ColWidths["Col2"]=0;
Result: The Col0, Col1 and Col2 in the grid is flashed.
Please help me to resolve this issue so the user doesn''t see this flashing.
Thanks,
Hoang
ADAdministrator Syncfusion Team June 16, 2005 07:47 AM UTC
Call this.dataGrid.BeginUpdate() before you set the datasource, and call this.dataGrid.EndUpdate after you set the ColWidths followed by this.dataGrid.Refresh().