Back to Devexpress

BaseOptionsView.ShowCaption Property

windowsforms-devexpress-dot-xtraverticalgrid-dot-baseoptionsview-9e140a52.md

latest3.6 KB
Original Source

BaseOptionsView.ShowCaption Property

Gets or sets whether the control displays a caption (Caption) at the top.

Namespace : DevExpress.XtraVerticalGrid

Assembly : DevExpress.XtraVerticalGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid

Declaration

csharp
[DefaultValue(false)]
[XtraSerializableProperty]
public virtual bool ShowCaption { get; set; }
vb
<DefaultValue(False)>
<XtraSerializableProperty>
Public Overridable Property ShowCaption As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true if the control displays a caption; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to ShowCaption
VGridControlBase

.OptionsView .ShowCaption

|

Remarks

Do the following to display a caption for the control:

Example

The following code snippet handles the VGridControl.RecordCountChanged event. The event handler updates the Vertical Grid’s caption (VGridControlBase.Caption) to display the visible record count and total record count.

See the following demo for the complete code: Run Demo: PC Market

csharp
vGridControl1.OptionsView.ShowCaption = true;
//...
// RecordCountChanged event handler:
void OnRecordCountChanged(object sender, System.EventArgs e) {
    UpdateCaption(vGridControl1.RecordCount, configurations.Count);
}
void UpdateCaption(int visible, int total) {
    vGridControl1.Caption = string.Format("Showing {0:n0} out of {1:n0} configurations", visible, total);
}
vb
vGridControl1.OptionsView.ShowCaption = True

' RecordCountChanged event handler:
Private Sub OnRecordCountChanged(ByVal sender As Object, ByVal e As System.EventArgs)
    UpdateCaption(vGridControl1.RecordCount, configurations.Count)
End Sub

Private Sub UpdateCaption(ByVal visible As Integer, ByVal total As Integer)
    vGridControl1.Caption = String.Format("Showing {0:n0} out of {1:n0} configurations", visible, total)
End Sub

See Also

Caption

BaseOptionsView Class

BaseOptionsView Members

DevExpress.XtraVerticalGrid Namespace