Skip to content

AddItem Method

Description

Adds a GridRecordItem to the collection of items.

Syntax

Public Function AddItem( _
    ByVal [Value](#) As Variant _
) As [GridRecordItem](XtremeGridControl~GridRecordItem.md)

Parameters

Remarks

If applicable (i.e., the value is text, number, etc.), the value will be displayed in the GridRecordItem if no caption has been set.

Example

Adding GridRecordItems to a GridRecord (Visual Basic)

This sample illustrates how to add GridRecordItems to a GridRecord.

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


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