Print all columns are hidden

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

3 Replies

AD Administrator 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


HD Hoang Dinh June 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


AD Administrator 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().

Loader.
Up arrow icon