RAD Studio |  |

Applying or Canceling a Range
Applying a range | Canceling a range | See Also
Collapse All

When you call SetRangeStart or EditRangeStart to specify the start of a range, or SetRangeEnd or EditRangeEnd to specify the end of a range, the dataset enters the dsSetKey state. It stays in that state until you apply or cancel the range.

Applying a range

When you specify a range, the boundary conditions you define are not put into effect until you apply the range. To make a range take effect, call the ApplyRange method. ApplyRange immediately restricts a user's view of and access to data in the specified subset of the dataset.

Canceling a range

The CancelRange method ends application of a range and restores access to the full dataset. Even though canceling a range restores access to all records in the dataset, the boundary conditions for that range are still available so that you can reapply the range at a later time. Range boundaries are preserved until you provide new range boundaries or modify the existing boundaries. For example, the following code is valid:

Copy Code

    .
    .
    .
    MyTable.CancelRange;
    .
    .
    .
    {later on, use the same range again. No need to call SetRangeStart, etc.}
    MyTable.ApplyRange;
    .
    .
    .

Copy Code

    .
    .
    .
    MyTable->CancelRange();
    .
    .
    .
    // later on, use the same range again. No need to call SetRangeStart, etc.
    MyTable->ApplyRange();
    .
    .
    .

See Also

Understanding the Differences Between Ranges and Filters

Modifying a Range

Setting Ranges

ApplyRange

ApplyRange

CancelRange

CancelRange

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!