> from within the form, but when using a component to do this the properties
> are no longer visible
> (DBGrid1 as TCustomDBGrid).Columns[i].Width)
> Does anyone have any suggestions ?
I'd add a field to your component, something like
protected
FGrid: TDBGrid;
and set the grid:
published
Grid: TDBGrid read FGrid write FGrid;
Then, before saving the grid column widths, assign the
grid to the component:
MyComponent.Grid := DBGrid1;
with MyComponent.Grid do
begin
// Save the columns here
end;
HTH,
Ken
--
Ken White
Clipper Functions for Delphi
http://www.adpsi.com
Well, yes. Do not cast to TCustomDBGrid, cast to TDBGrid, if you need to cast
at all. The TCustom classes you find in the VCL do not publish any properties
and have many things as protected that is than published by descendents.
Peter Below (TeamB) 10011...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Note: I'm unable to visit the newsgroups every day at the moment,
so be patient if you don't get a reply immediately.