Skip to content

Caption Property

Description

The text caption for the column header.

Property Type

Read-write property

Syntax (Visual Basic)

Public Property Caption() As String

Remarks

The caption of the column header is set when the column is added to the GridControl. You can retrieve or change the column header text with the caption property.

Example

Setting/Changing the Text in the Column Header (Visual Basic)

This sample illustrates how to change the caption of a column. The caption is the text that is displayed in the column header.

' Add this to the General code section  
Const COLUMN_NAME = 1  

' This code is placed in the Form_Load event  
Dim Column As GridColumn  

' The text in the column header is initially "Name" when created  
Set Column = wndGridControl.Columns.Add(COLUMN_NAME, "Name", 300, True)  

' The text in the column header is now changed to "First Name"  
Column.Caption = "First Name"  

' Or you can access the column this way  
wndGridControl.Columns(COLUMN_NAME).Caption = "First Name"  

See Also


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