Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+
Row

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.v19.1.Core.dll

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