Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to hide a dbgrid column in Delphi 3?

1,068 views
Skip to first unread message

Jeff Carpenter

unread,
Apr 11, 2001, 5:25:30 PM4/11/01
to
Does anyone know how to hide a dbgrid column in Delphi 3?

You cannot use dbgrid.columns[i].visible := FALSE;

-Jeff

Brian Bushay TeamB

unread,
Apr 11, 2001, 9:14:20 PM4/11/01
to

>You cannot use dbgrid.columns[i].visible := FALSE;

Why got. That works for me.
--
Brian Bushay (TeamB)
Bbu...@NMPLS.com

Jeff Carpenter

unread,
Apr 12, 2001, 11:14:04 AM4/12/01
to
Well, it does not compile for me, I get an "undeclared identifier"
error message when compiling!

-Jeff

Dell Stinnett

unread,
Apr 12, 2001, 5:49:52 PM4/12/01
to
You could make the field not visible and it wouldn't show up in the grid:

MyTable.FieldByName('MyField').Visible := False;


-Dell


Jeff Carpenter

unread,
Apr 12, 2001, 5:59:21 PM4/12/01
to
Thanks Dell but I had tried that before. The code does compile, but
it has no effect, perhapas because of the persistent columns.

dm.qryInfo.FieldByName('Email').Visible := False;

Brian Bushay TeamB

unread,
Apr 12, 2001, 11:14:43 PM4/12/01
to

>Well, it does not compile for me, I get an "undeclared identifier"
>error message when compiling!
Ok I see you are using Delphi 3 and I am not sure Delphi 3 had Tcolumns.
can you right click on the Grid and create Tcolumns?

If not try just setting the Tfield's visible property

Jeff Carpenter

unread,
Apr 13, 2001, 11:04:59 AM4/13/01
to
Yes, I can create columns. I've tried setting the field's visible
property before, and while the code does compile, it has no effect
whatsoever on the grid!

GridAll.Columns[4].Field.Visible := false;

Thanks anyway,

-Jeff

Chris Luck

unread,
Apr 13, 2001, 11:33:56 AM4/13/01
to
Answered in vcl.components.using.

--
Regards,
Chris Luck

0 new messages