Skip to main content
Row

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

ChartSheetCollection.Insert(Int32) Method

Creates a new chart sheet and appends it to the collection at the specified position.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

#Declaration

ChartSheet Insert(
    int index
)

#Parameters

Name Type Description
index Int32

A zero-based integer which specifies the position at which a new chart sheet should be inserted.

#Returns

Type Description
ChartSheet

A ChartSheet object that specifies the created chart sheet.

#Remarks

The Insert method creates a new chart sheet under the default name like ChartN, where N is a number that is greater by 1 than the maximum number used in chart sheet names of the same type. To change the chart sheet name, use the ChartSheet.Name property.

If the index passed as a parameter to this method is less than zero, or exceeds the number of chart sheets in the collection, this method throws an exception of the ArgumentOutOfRangeException type.

Use the ChartSheet.Chart property to access a chart located on the chart sheet and specify its settings (select chart data, change the chart type and adjust its appearance). By default, a chart sheet created by the current Insert method overload contains an empty chart of the ChartType.ColumnClustered type.

To insert a new chart sheet at the end of the collection, use the ChartSheetCollection.Add method.

To remove a chart sheet from the collection, use the ChartSheetCollection.Remove or ChartSheetCollection.RemoveAt method.

See Also