Caption Property
Description
The text displayed in the GridRecordItem.
Property Type
Read-write property
Syntax (Visual Basic)
Public Property Caption() As String
Remarks
This is the text that is displayed in the GridRecordItem. If no caption is assigned, the information stored in the value property will be displayed in the GridRecordItem if possible.
Example
Adding a Caption to a GridRecordItem (Visual Basic)
This sample illustrates how to add a Caption to a GridRecordItem at runtime and when the item is added to the GridControl.
Dim Record As GridRecord
Dim Item As GridRecordItem
' Adds a record/row to the GridControl
Set Record = wndGridControl.Records.Add
Set Item = Record.AddItem("")
Item.HasCheckbox = True
Item.Checked = False
' Adds a GridRecordItem with a value of "RE: Your Invoice"
Set Item = Record.AddItem("RE: Your Invoice")
' Sets the texts that will be displayed in the GridRecordItem to "Important - Read Now"
' If the caption is not set, then the value of the GridRecordItem, which is "RE: Your Invoice" is displayed
Item.Caption = "Important - Read Now!"
Item.BackColor = RGB(178, 180, 191)
Item.ForeColor = &HFF
Record.AddItem "John Smith"
Record.AddItem "19/06/2004"
Record.AddItem "18k"
' Add the record/row to the GridControl
wndGridControl.Populate
' This code will change the Caption of the 2nd GridRecordItem in the
' 1st GridRecord/Row at runtime. This will change the text displayed from "Important - Read Now!"
' to "Blocked Spam".
wndGridControl.Records(0).Item(1).Caption = "Blocked Spam"
See Also
- GridRecordItem Object
- TextColor Property
- GridRecordItemMetrics ForeColor Property
- GridPaintManager CaptionFont Property
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.