Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SpreadsheetControl.ColumnsInserting Event

Occurs when new columns are about to be inserted into a worksheet.

Namespace: DevExpress.XtraSpreadsheet

Assembly: DevExpress.XtraSpreadsheet.v24.2.dll

NuGet Package: DevExpress.Win.Spreadsheet

#Declaration

public event ColumnsChangingEventHandler ColumnsInserting

#Event Data

The ColumnsInserting event's data class is ColumnsChangingEventArgs. 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.
Count Gets the number of rows/columns that will be inserted or removed. Inherited from RowsColumnsChangingEventArgsBase.
StartIndex Gets the index of the first row/column after which rows/columns will be inserted or removed. Inherited from RowsColumnsChangingEventArgsBase.

#Remarks

The ColumnsInserting event allows you to perform any actions before an end-user adds new columns using the control’s UI. You can cancel inserting new columns by setting the event parameter’s Cancel property to true.

After new columns have been inserted, the SpreadsheetControl.ColumnsInserted event is raised.

Note

By default, the ColumnsInserting event does not occur when adding new columns in code. However, this event will also be triggered by changes made via an API if you set the WorkbookEventOptions.RaiseOnModificationsViaAPI property (accessible via the SpreadsheetControl.Options.Events.RaiseOnModificationsViaAPI notation) to true.

See Also