Object Reference > True DBGrid Methods > Add Method |
Add Method
Adds a new item to a collection.
object.Add(item)
Method applies to Columns, GroupColumns, Layouts, PrintInfos, SelBookmarks, Splits, Styles, and ValueItems collections.
Arguments
item is an expression or object that specifies the member to add to the collection.
Return Value
A reference to the newly created object where appropriate, otherwise none.
For the Columns, GroupColumns, PrintInfos, Splits, and Styles collections, this method creates a new instance of the appropriate object, adds it to the collection, and returns it to the caller.
For the Layouts, SelBookmarks, and ValueItems collections, this method adds the specified object to the collection without returning a value.
The data type of the item argument depends on the collection. For the Columns and Splits collections, item is a zero-based integer denoting the index of the newly created Column or Split object.
For the SelBookmarks collection, item is a variant representing a bookmark that identifies a particular row. Depending upon the setting of the DataMode property, item may have been obtained from a bound data source, an unbound mode or application mode event, or an XArrayDB row index.
For the Styles collection, item is the unique name of the Style object to be created. Similarly, for the PrintInfos collection, item is the unique name of the PrintInfo object to be created.
For the ValueItems collection, item is an independent ValueItem object.
For the Layouts collection, item is the name of a grid layout to be saved to the binary layout file specified by the LayoutFileName property. All of the grid's persistent properties are saved in their current state. If the named layout already exists in the file, the property settings are overwritten. If the named layout does not already exist, it is added to the file.
Column Object, Columns Collection
Split Object, Splits Collection
Style Object, Styles Collection