Subject | RE: [IBO] IB_Grid and SrollBar issues. |
---|---|
Author | Helen Borrie |
Post date | 2005-05-16T01:58:06Z |
Christopher Hart wrote:
receive. It adjusts the thumb on the scrollbar as the size of the row
buffer increases.
Setting AutoFetchAll *does* force the dataset to fetch all rows. But the
IB_Datasource will continue its default behaviour of adjusting the
scrollbar as it "counts in" the selected records.
you want it to by this method alone.
If you really want to hold up your interface while waiting for all of the
rows, open the dataset inside a DisableInterface block. If you want to go
the AutoFetchall route, this should have the desired effect:
with MyGrid.Datasource do
begin
DisableInterface;
try
Dataset.Open;
finally
EnableInterface;
end;
end;
Calling FetchAll yourself conditionally at runtime is probably preferable
to setting AutoFetchAll, since it allows you to let the user decide which
behaviour s/he wants - a crazy thumb versus a slow interface.
with MyGrid.Datasource do
begin
DisableInterface;
try
if not Dataset/Prepared then Dataset.Prepare;
if UserWantsSlow then
Dataset.FetchAll
else
Dataset.Open;
finally
EnableInterface;
end;
end;
Helen
> > This is how IB_Objects Grids are designed. It makes the applicationAt 11:00 AM 16/05/2005 +1000, you wrote:
> > much more responsive to only bring in the records are immediately
> > needed. If you want to have all records ready for the Grid you will
> > need to do A FetchAll.
>Hi Christopher,The dataset has no way, ahead of time, to know how many rows it will
>
>I have definitely set the AutoFetchAll = true. But the problem remains.
receive. It adjusts the thumb on the scrollbar as the size of the row
buffer increases.
Setting AutoFetchAll *does* force the dataset to fetch all rows. But the
IB_Datasource will continue its default behaviour of adjusting the
scrollbar as it "counts in" the selected records.
>Please correct me if I have miss interpret you. So my understanding, is thatIf the number of records is very large, you won't get it to work the way
>by setting AutoFetchAll = true, the scroll bars on IB Grid, will not display
>a true representation of the number of records. For this to work correctly,
>I can only fetch a small number of records?
you want it to by this method alone.
If you really want to hold up your interface while waiting for all of the
rows, open the dataset inside a DisableInterface block. If you want to go
the AutoFetchall route, this should have the desired effect:
with MyGrid.Datasource do
begin
DisableInterface;
try
Dataset.Open;
finally
EnableInterface;
end;
end;
Calling FetchAll yourself conditionally at runtime is probably preferable
to setting AutoFetchAll, since it allows you to let the user decide which
behaviour s/he wants - a crazy thumb versus a slow interface.
with MyGrid.Datasource do
begin
DisableInterface;
try
if not Dataset/Prepared then Dataset.Prepare;
if UserWantsSlow then
Dataset.FetchAll
else
Dataset.Open;
finally
EnableInterface;
end;
end;
Helen