Skip to content

Record Property

Description

Reference to the associated GridRecord.

Property Type

Read-write property

Syntax (Visual Basic)

Public Property Record() As [GridRecord](XtremeGridControl~GridRecord.md)

Remarks

A GridRecord needs to be associated with a GridRow before it can be shown in the GridControl. The GridRecordItems associated with the GridRecord are the individual cells that are displayed in the GridColumns of the GridControl.

Rows are added using the add method and removed using the RemoveAt method. When a record is added, it is automatically attached to a row and is accessed through the Record property. By removing or adding a GridRecord, you are adding or removing a GridRow that displays the GridRecord information.

Example

Accessing the GridRecordItems of a GridRecord/GridRow (Visual Basic)

This sample illustrates how to access the individual GridRecordItems of a GridRecord/GridRow.

' The KeyDown event can be used to determine when the SpaceBar (SpaceBar keycode = 32) is pressed.  

Private Sub wndGridControl_KeyDown(KeyCode As Integer, Shift As Integer)  

    On Error Resume Next  

    ' If the spacebar is pressed, execute this code  
    If (KeyCode = 32) Then  
        Dim Item As GridRecordItem  
        ' wndGridControl.FocusedRow is a GridRow object, the first GridRecordItem of  
        ' the attached GridRecord is retrieved and a reference is placed into the Item variable  
        Set Item = wndGridControl.FocusedRow.Record(0)  

        ' Toggles the state of the GridRecordItem's checkbox (removes/replaces the check mark)  
        Item.Checked = Not Item.Checked  

        ' Or you can access the Checked property of the GridRecordItem directly  
        wndGridControl.FocusedRow.Record(0).Checked = Not wndGridControl.FocusedRow.Record(0).Checked  
    End If  
End Sub

See Also


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