From TDBGrid's ancestor . . .
TCustomGrid >> TDBGrid.TopRow
TCustomGrid >> TDBGrid.VisiblrRowCount
Alan Lloyd
<alang...@aol.com> ha scritto nel messaggio
news:d566e233-4f27-48cf...@f8g2000yqn.googlegroups.com...
Look in Delphi Help for TDBGrid and Heirarchy. You will see that
TDBGrid is descended from TCustomDBGrid & TCustom Grid. Click on
TCustomGrid & then click on Properties in TCustomGrid. You will see
TopRow & VisibleRowCount in the list with (in D3) a yellow square
showing they are Protected properties.
Protected properties are not exposed (ie made available) except
explicitly by a descendant class _OR_ by typecasting to a new
descendant class. So you cannot (as you have found) access them as
properties of a TDBGrid.
But you can access them by declaring a descendant class of TDBGrid
(any name but I usually use a name meaningful for the purpose) :-
class
TDBGridRows = class(TDBGrid);
Then you can access the properties by :-
MyTopRow := TDBGridRows(TDBGrid).TopRow;
MyVisibleRows := TDBGridRows(TDBGrid).VisibleRowCount;
Protected & private properties are always there, but the compiler
prevents you accessing them unless you cheat <g>.
Alan Lloyd
<alang...@aol.com> ha scritto nel messaggio
news:7684f21c-0a4a-4139...@k41g2000yqm.googlegroups.com...