[]
Represents methods for the embedded editor.
public interface IEmbeddedEditor
Public Interface IEmbeddedEditor
If you want to use a third-party editor, consider creating a derived class and implementing this interface.
Editors inside that use the IEmbeddedEditor interface must be initialized when this editor is initialized.
Also, do not call the UpdateBounds method of editors of type IEmbeddedEditor inside the UpdateBounds method of this editor.
The following code example shows how to create an editor that contains other editors.
public class ComplexEditor : Control, IEmbeddedEditor
{
private C1NumericEdit _c1NumericEdit = new C1NumericEdit();
private Button _button = new Button();
private TextBox _textBox = new TextBox();
public ComplexEditor()
{
Controls.Add(_c1NumericEdit);
Controls.Add(_button);
Controls.Add(_textBox);
}
public UITypeEditorEditStyle GetEditStyle() => _c1NumericEdit.GetEditStyle();
public object GetValue() => _c1NumericEdit.Value;
public bool HandleFinishEdit(KeyEventArgs e) => _c1NumericEdit.HandleFinishEdit(e);
public void Initialize(object value, IDictionary attrs) => _c1NumericEdit.Initialize(value, attrs);
public bool IsValueValid() => _c1NumericEdit.IsValueValid();
public void SetFormat(string format) => _c1NumericEdit.SetFormat(format);
public void UpdateBounds(Rectangle rc) => Bounds = rc;
}
| Name | Description |
|---|---|
| GetEditStyle() | Gets the editor style, which determines the type of button that is displayed in the cell before and during editing (DropDown, Modal, or None). |
| GetValue() | Gets the current value of the editor. |
| HandleFinishEdit(KeyEventArgs) | Gets a value that determines whether a given key should finalize editing. |
| Initialize(object, IDictionary) | Initializes the editor content and styles. |
| IsValueValid() | Gets a value that determines if the editor's current contents are valid. |
| SetFormat(string) | Sets the format string used to display the value when the control is in edit mode. |
| UpdateBounds(Rectangle) | Updates the editor's size and position. |