Borland®
Shop
Products Downloads Services Support Partners News & Events Company Community
Delphi
Documentation
Support

Additional Resources
Technology Partners
Books
Community

 Using Multiselect Database Grids - 2.0

When you add [dgMultiSelect] to the Options property of a DBGrid, you give yourself the ability to select multiple records within the grid.

The records you select are represented as bookmarks and are stored in the SelectedRows property.

The SelectedRows property is an object of type TBookmarkList. The properties and methods are described below.

Click here to download an example.

   property SelectedRows: TBookmarkList read FBookmarks;
     TBookmarkList = class
     public
    {* The Clear method will free all the selected records
        within the DBGrid *}
        procedure Clear;
    {* The Delete method will delete all the selected rows
       from the dataset *}
       procedure Delete;
    {* The Find method determines whether a bookmark is
       in the selected list. *}
       function  Find(const Item: TBookmarkStr;
            var Index: Integer): Boolean;
    {* The IndexOf method returns the index of the
       bookmark within the Items property. *}
       function IndexOf(const Item: TBookmarkStr): Integer;
    {* The Refresh method returns a boolean value to notify
       whether any orphans were dropped (deleted) during the
       time the record has been selected in the grid.  The
       refresh method can be used to update the selected list
       to minimize the possibility of accessing a deleted
       record. *}
       function  Refresh: Boolean;  True = orphans found
    {* The Count property returns the number of currently
       selected items in the DBGrid *}
       property Count: Integer read GetCount;
    {* The CurrentRowSelected property returns a boolean
       value and determines whether the current row is
       selected or not. *}
       property CurrentRowSelected: Boolean
            read GetCurrentRowSelected
            write SetCurrentRowSelected;
    {* The Items property is a TStringList of
       TBookmarkStr *}
       property Items[Index: Integer]: TBookmarkStr
            read GetItem; default;
  end;

DISCLAIMER: You have the right to use this technical information subject to the terms of the No-Nonsense License Statement that you received with the Borland product to which this information pertains.

 
Site Map Search Contact