Back to Devexpress

LayoutGroup.CustomHeaderButtons Property

windowsforms-devexpress-dot-xtralayout-dot-layoutgroup-4a724858.md

latest3.2 KB
Original Source

LayoutGroup.CustomHeaderButtons Property

Gets or sets the collection of custom buttons displayed in the group header.

Namespace : DevExpress.XtraLayout

Assembly : DevExpress.XtraLayout.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[ListBindable(false)]
[DXCategory("Behavior")]
public virtual BaseButtonCollection CustomHeaderButtons { get; }
vb
<ListBindable(False)>
<DXCategory("Behavior")>
Public Overridable ReadOnly Property CustomHeaderButtons As BaseButtonCollection

Property Value

TypeDescription
DevExpress.XtraEditors.ButtonPanel.BaseButtonCollection

A collection of buttons displayed in the group header.

|

Remarks

Use the CustomHeaderButtons property to add custom buttons to the group header:

At design time, you can add buttons to the CustomHeaderButtons collection using a dedicated editor.

The location of header buttons (the group’s expand button and custom buttons) can be set with the LayoutGroup.HeaderButtonsLocation property.

To respond to clicking/checking custom buttons, handle the LayoutGroup.CustomButtonClick, LayoutGroup.CustomButtonChecked and LayoutGroup.CustomButtonUnchecked events.

Example

The code below handles the LayoutGroup.CustomButtonClick event to hide the layout group with a click on a button in its header. To add buttons to the header, use the CustomHeaderButtons collection.

csharp
private void layoutControlGroup1_CustomButtonClick(object sender, DevExpress.XtraBars.Docking2010.BaseButtonEventArgs e) {
    LayoutControlGroup layoutGroup = sender as LayoutControlGroup;
    if (e.Button.Properties.Caption == "Hide")
        layoutGroup.HideToCustomization();
}
vb
Private Sub layoutControlGroup1_CustomButtonClick(ByVal sender As Object, ByVal e As DevExpress.XtraBars.Docking2010.BaseButtonEventArgs) _
    Handles layoutControlGroup1.CustomButtonClick
    Dim layoutGroup As LayoutControlGroup = TryCast(sender, LayoutControlGroup)
    If e.Button.Properties.Caption = "Hide" Then
        layoutGroup.HideToCustomization()
    End If
End Sub

See Also

LayoutGroup Class

LayoutGroup Members

DevExpress.XtraLayout Namespace