In addition to the predefined CellViewerManagers and CellEditorManagers provided with Xceed Grid for WinForms, the CellViewerManager and CellEditorManager classes, as well as their child classes, can be derived from to create custom CellViewerManagers and CellEditorManagers.
The custom CellViewerManagers and CellEditorManagers can then be assigned to the CellViewerManager and/or CellEditorManager properties of the desired column or cell, or to the CellViewerManagerMapping and/or CellEditorManagerMapping properties of the GridControl class. For example:
VB.NET | Copy Code |
---|---|
GridControl1.CellEditorManagerMapping( GetType( Boolean ) ) = New CustomBooleanEditor() |
C# | Copy Code |
---|---|
gridControl1.CellEditorManagerMapping[ typeof( bool ) ] = new CustomBooleanEditor(); |
Both the CellViewerManager and CellEditorManager classes expose a protected virtual "Core" version of most of the public methods (for example, GetFittedWidthCore). When deriving from either of these classes, the "Core" methods can be overridden to add to or replace their existing behavior. The events associated with each method are not raised by the "Core" version of the method but rather by the public "non-Core" version (for example, the corresponding GetFittedWidth method). However, even if the base implementation is not called in the "Core" version, the associated event will still be raised after the "Core" method is called. For example, if the GetFittedWidthCore method of the CellViewerManager class is overridden and the base implementation ignored, the GetFittedWidth method will still be called (by the underlying private implementation) and the QueryFittedWidth event will be raised.
The following classes demonstrates how to derive from the CellEditorManager class to create custom CellEditorManagers:
The following classes demonstrates how to derive from the CellViewerManager class to create custom CellViewerManagers: