wpf-devexpress-dot-xpf-dot-spreadsheet-dot-spreadsheetcustomcellediteventargs-a7ca86aa.md
Gets a value associated with the CustomCellInplaceEditor object assigned to the cell.
Namespace : DevExpress.Xpf.Spreadsheet
Assembly : DevExpress.Xpf.Spreadsheet.v25.2.dll
NuGet Package : DevExpress.Wpf.Spreadsheet
public ValueObject ValueObject { get; }
Public ReadOnly Property ValueObject As ValueObject
| Type | Description |
|---|---|
| ValueObject |
A ValueObject object associated with the custom cell editor.
|
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.
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;
}
}
AddHandler spreadsheetControl.CustomCellEdit, AddressOf spreadsheetControl1_CustomCellEdit
' ...
Private Sub spreadsheetControl1_CustomCellEdit(ByVal sender As Object, ByVal e As SpreadsheetCustomCellEditEventArgs)
' 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 AndAlso e.ValueObject.TextValue = "MySpinEdit" Then
' Create a SpinEdit in-place editor and assign it to a cell.
Dim settings As New SpinEditSettings()
settings.MinValue = 1
settings.MaxValue = 1000
settings.IsFloatValue = False
e.EditSettings = settings
End If
End Sub
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
SpreadsheetCustomCellEditEventArgs Class