Subject Re: Grid and column widths
Author squidsrus85
Hi Markus,

Thanks for the quick reply. OK, that worked fine. I have the same data displayed in other Grids so I will use the GridLinks option as it is not Global.

I'll just add the syntax in this reply for anyone coming along later. This will set the Width to 200 pixels for the Name Field and Center Align the data.

TIB_Grid.GridLinks : TIB_StringList
name=WIDTH=200;ALIGN=C

Dave


--- In IBObjects@yahoogroups.com, Markus Ostenried <macnoz@...> wrote:
>
> On Sat, Aug 13, 2011 at 02:58, squidsrus85 <squidsrus85@...> wrote:
> > Hi All,
> >
> > Is there a way to edit the column width in TB_Grid?
> >
> > There seems to be no Columns Editor and no "Columns[x].Width" property to change width either at design time or run time.
> >
> > Dave
>
> You need to set FieldsDisplayWidth property of your dataset. You can
> do that in the dataset's property editor on the tab Data (you need to
> prepare or open the dataset first): then adjust the column widths in
> the grid.
> When you click the Apply or Ok button this be saved in the
> FieldsDisplayWidth property of the dataset (look at that property in
> the object inspector).
>
> For this you can set defaults in IB_Connection.FieldsDisplayWidth.
>
> And you can also overwrite this in the IB_Grid.GridLinks property.
> Or set it at runtime with
> FieldByName('name').DisplayWidth := 200;
>
> HTH,
> Markus
>