Hello
I would like to know which is the best way to hide some columns in the preview dialog (print).
I mean. My grid have some columns with width = 0. (hidden).
Unfortunately the advpreviewdilaog show this column during printing. I would like to know how to hide.
Thanks
The correct way to hide a column is to call grid.HideColumn(columnindex);
Dear Bruno.
I use your methods in order to hide a column. And Works. But my aim is to hide columns only during printing (dialog printing) and not hide in the form. Which is the right way to achieve so?
Many Thanks
Hide the column before calling grid.Print and after this call, unhide again?
Yes.. i will try but.. I would like to avoid flickering of the grid. I hope that there was a property of a column such "printing" or other that setted to false not print.. However..i will do so as you suggest me
Thanks
procedure TFormMontaggioSmontaggioPrepare.AdvPreviewDialog1Close(
Sender: TObject);
begin
with DbgMontaggioSmontaggio Do
Begin
UnHideColumn(DbgMontaggioSmontaggio.ColumnByName['colStatus'].Index);
UnHideColumn(DbgMontaggioSmontaggio.ColumnByName['colCHI_SOST'].Index);
End;
end;
procedure TFormMontaggioSmontaggioPrepare.AdvPreviewDialog1Show(
Sender: TObject);
begin
with DbgMontaggioSmontaggio Do
Begin
HideColumn(DbgMontaggioSmontaggio.ColumnByName['colStatus'].Index);
HideColumn(DbgMontaggioSmontaggio.ColumnByName['colCHI_SOST'].Index);
End;
end;
sorry .. I put the code above..but the events does not fire
- We've fixed the issue with OnClose/OnShow on the TAdvPreviewDialog. Next update will address this.2) To hide/unhide without updating the screen, you can do this between grid.BeginUpdate/grid.EndUpdate statements.