Skip to content

Add Method

Description

Adds a new GridRecord to the collection of records.

Syntax

Public Function Add() As [GridRecord](XtremeGridControl~GridRecord.md)

Return Type

Reference to the newly added GridRecord.

Remarks

Adds a new GridRecord to the end of the record collection. The Add method will also add a new GridRow to the GridControl's collection of rows and the new GridRecord is referenced by the GridRow's Record property. The new GridRow will display the GridRecord's GridRecordItems.

Example

This sample illustrates how to add a new GridRecord/GridRow to the GridControl.

Dim Record As GridRecord  
Dim Item As GridRecordItem  

' Adds a new record/row to the GridControl  
Set Record = wndGridControl.Records.Add  

    ' Adds a GridRecordItem to the new GridRecord referenced in the Record variable  
    Set Item = Record.AddItem("")  
        Item.HasCheckbox = True  
        Item.Checked = False  

    ' Adds a GridRecordItem with a value of "RE: Your Invoice" to the new GridRecord referenced in the Record variable  
    Record.AddItem "RE: Your Invoice"  

    ' Adds a GridRecordItem with a value of "John Smith" to the new GridRecord referenced in the Record variable  
    Record.AddItem "John Smith"  

    ' Adds a GridRecordItem with a value of "19/06/2004" to the new GridRecord referenced in the Record variable  
    Record.AddItem "19/06/2004"  

    ' Adds a GridRecordItem with a value of "18k" to the new GridRecord referenced in the Record variable  
    Record.AddItem "18k"  

' Add the record/row to the GridControl  
wndGridControl.Populate

See Also

GridRecords Collection


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.