How do you hide a DBGrid column? I tried DBGrid.Column(0).Visible = False but it didn't work, dunno why?
Printable View
How do you hide a DBGrid column? I tried DBGrid.Column(0).Visible = False but it didn't work, dunno why?
easiest way is ususally to set it's width to 0
Yes, I tried that, also. No error, it just seemed to ignore it. In Debug mode, everything evaluates as they should, the properties I mean.
Bit of an amature at this VB stuff but heres how I hid a column using DBGrid:
Dim Col1, Col2 as Column
Set Col1 = DBGrid1.Columns(0)
Set Col2 = DBGrid1.Columns(1)
Col1.Caption = "Invisible"
Col2.Caption = "Column 2"
Col1.Visible = False
Hope it helps you