Board index » delphi » Accessing properties of a DBGrid

Accessing properties of a DBGrid

How do I access the properties of columns in a DBGrid.

I need to obtain the width of each column at run-time.
--
=================
Ian D Cope
i.d.c...@leeds.ac.uk

 

Re:Accessing properties of a DBGrid


Try the Columns property.

-------8<-------------------

YourWidth : Integer;

with YourDBGrid.Columns do
 for i := 0 to Count-1 do
  YourWidth := Items[i].Width.

-------8<-------------------

HTH,
 Nandan Kalle

Other Threads