Skip to main content

SpreadsheetCustomCellEditEventArgs.ValueObject Property

Gets a value associated with the CustomCellInplaceEditor object assigned to the cell.

Namespace: DevExpress.Xpf.Spreadsheet

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

NuGet Package: DevExpress.Wpf.Spreadsheet

Declaration

public ValueObject ValueObject { get; }

Property Value

Type Description
ValueObject

A ValueObject object associated with the custom cell editor.

Remarks

If you use the CustomCellInplaceEditorCollection.Add method to embed a custom in-place editor of a particular type in a cell or cell range and assign a ValueObject to it, you can handle the SpreadsheetControl.CustomCellEdit event and use the event’s ValueObject parameter to: (1) Identify the custom editor associated with the given ValueObject to adjust the editor’s properties or – (2) Assign a specific editor to the affected cells if the editor of the CustomCellInplaceEditorType.Custom type has been used. The second approach is shown in the example below.

View Example

    spreadsheetControl.CustomCellEdit += spreadsheetControl1_CustomCellEdit;
    // ...
private void spreadsheetControl1_CustomCellEdit(object sender, SpreadsheetCustomCellEditEventArgs e)
{
    // Specify a type of the custom editor assigned to cells of the "Quantity" table column.
    // To identify the custom editor, use a value of ValueObject associated with it. 
    if (e.ValueObject.IsText && e.ValueObject.TextValue == "MySpinEdit")
    {
        // Create a SpinEdit in-place editor and assign it to a cell. 
        SpinEditSettings settings = new SpinEditSettings();
        settings.MinValue = 1;
        settings.MaxValue = 1000;
        settings.IsFloatValue = false;
        e.EditSettings = settings;
    }
}

If no CustomCellInplaceEditor is assigned to the processed cell or the custom cell editor doesn’t contain any ValueObject associated with it, the ValueObject property returns an empty object (the ValueObject.IsEmpty property is true).

For more information on how to embed custom in-place editors within worksheet cells, see the Custom Cell In-place Editors example.

See Also