Skip to main content
All docs
V24.2

SpreadsheetControl.BeforeOutlineButtonClick Event

Fires before a user clicks an outline button for row or column groups.

Namespace: DevExpress.Xpf.Spreadsheet

Assembly: DevExpress.Xpf.Spreadsheet.v24.2.dll

NuGet Package: DevExpress.Wpf.Spreadsheet

Declaration

public event BeforeOutlineButtonClickEventHandler BeforeOutlineButtonClick

Event Data

The BeforeOutlineButtonClick event's data class is BeforeOutlineButtonClickEventArgs. The following properties provide information specific to this event:

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
IsRowOutline Indicates whether a user clicks the outline button for row groups.
Level Returns the group level that corresponds to the outline button a user clicks.

Remarks

The WPF Spreadsheet control ships with a set of events that allow you to control the expand/collapse operations for row and column groups in a worksheet.

The following events occur when a user clicks a plus Spreadsheet - Plus Outline Symbol / minus Spreadsheet - Minus Outline Symbol symbol on the outline bar (or the Hide Detail/Show Detail button on the Data ribbon tab):

The following events occur when a user clicks one of the outline buttons Spreadsheet - Outline Buttons to expand/collapse row or column groups:

The BeforeOutlineButtonClick event fires before an outline button is clicked and the expand/collapse operation is executed. Enable the Cancel property of the event data class to cancel the operation. The event’s IsRowOutline argument allows you to determine whether a user clicks an outline button for row or column groups, and the Level argument returns the group level that corresponds to this outline button.

Use the following code to ensure that the Spreadsheet control does not collapse all column groups when a user clicks the outline button 1:

spreadsheetControl.BeforeOutlineButtonClick += (s, e) => {
    if (e.Level == 1 && !e.IsRowOutline)
        e.Cancel = true;
};
See Also