> > Hi Russell -
> >
> > Your desired grid.Height would probably the number of rows * grid.RowHeight + SysMetric(8) + grid.HeaderHeight
> >
> >
> > hth
> > -Stefan
>
> Beautiful Stefan - that works well. I'll keep SYSMETRIC in mind in similar situations.
You're welcome! I forgot the grid.LineWidth if grid.GridLines=3 or 1:
CREATE CURSOR temp (test i)
INSERT INTO temp VALUES (1)
INSERT INTO temp VALUES (2)
INSERT INTO temp VALUES (3)
o = CREATEOBJECT('Form')
o.AddObject('g','Grid')
o.g.Move(0,0,o.Width,o.Height)
o.g.Anchor = 15
o.g.Visible = .T.
o.Height = RECCOUNT('temp') * o.g.RowHeight + SysMetric(8) + o.g.HeaderHeight
o.Show()
&& forgotten grid.LineWidth:
o.Height = o.Height + RECCOUNT('temp') * o.g.GridLineWidth
hth
-Stefan