Back to Devexpress

CustomCellInplaceEditorCollection.Add(CellRange, CustomCellInplaceEditorType, ValueObject, Boolean) Method

officefileapi-devexpress-dot-spreadsheet-dot-customcellinplaceeditorcollection-dot-add-x28-cellrange-customcellinplaceeditortype-valueobject-boolean-x29.md

latest5.0 KB
Original Source

CustomCellInplaceEditorCollection.Add(CellRange, CustomCellInplaceEditorType, ValueObject, Boolean) Method

Creates a cell in-place editor of the CustomCellInplaceEditorType.ComboBox type and assigns it to the specified cell range.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
CustomCellInplaceEditor Add(
    CellRange range,
    CustomCellInplaceEditorType editorType,
    ValueObject value,
    bool useOnlyVisibleDataRange
)
vb
Function Add(
    range As CellRange,
    editorType As CustomCellInplaceEditorType,
    value As ValueObject,
    useOnlyVisibleDataRange As Boolean
) As CustomCellInplaceEditor

Parameters

NameTypeDescription
rangeCellRange

A CellRange object that specifies a cell or cell range to which the custom in-place editor should be assigned.

| | editorType | CustomCellInplaceEditorType |

A CustomCellInplaceEditorType.ComboBox enumeration member indicating that a combo box editor is used for cell editing.

| | value | ValueObject |

A ValueObject object that specifies a list of items obtained from a worksheet range to be displayed in the combo box editor’s drop-down list.

| | useOnlyVisibleDataRange | Boolean |

A Boolean value that specifies whether the hidden values in the cell range from which combo box items are obtained should be included into the editor’s item list.

|

Returns

TypeDescription
CustomCellInplaceEditor

A CustomCellInplaceEditor object that specifies the created cell in-place editor.

|

Remarks

This method overload is used only for the in-place editor of the CustomCellInplaceEditorType.ComboBox type whose items originate from a cell range (using the ValueObject.FromRange property) and allows you to specify whether values of hidden cells should be included into the editor’s item list. Using this method overload in other cases will trigger a System.ArgumentException.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Add(CellRange, CustomCellInplaceEditorType, ValueObject, Boolean) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-spreadsheet-use-custom-cell-editors/VB/DevAVInvoicing/Form1.vb#L43

vb
Dim stores As Worksheet = workbook.Worksheets("Stores")
invoice.CustomCellInplaceEditors.Add(invoice("G12:I12"), CustomCellInplaceEditorType.ComboBox, ValueObject.FromRange(stores("D5:D204")), True)
' Use a combo box editor as the in-place editor for cells containing a sales representative's name in the "Sales Rep." column.

See Also

Custom Cell In-place Editors

CustomCellInplaceEditorCollection Interface

CustomCellInplaceEditorCollection Members

DevExpress.Spreadsheet Namespace