Enables value editing via editors created over cells
Namespace: Dapfor.Net.EditorsAssembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)
Syntax
C# |
---|
public interface IGridEditorService : IWindowsFormsEditorService |
Visual Basic |
---|
Public Interface IGridEditorService
Inherits IWindowsFormsEditorService |
Visual C++ |
---|
public interface class IGridEditorService : IWindowsFormsEditorService |
F# |
---|
type IGridEditorService =
interface
interface IWindowsFormsEditorService
end |
Examples
Demonstrates how to customize the drawing in editing cell
| Copy |
---|
public class CheckBoxEditor : UITypeEditorEx
{
public override bool GetPaintCellSupported()
{
return true;
}
public override void PaintCell(PaintCellEventArgs e)
{
e.Parts &= e.Parts ^ PaintPart.Text;
base.PaintCell(e);
Rectangle bounds = e.Cell.VirtualBounds;
int len = bounds.Height;
bounds.X += (bounds.Width - len) / 2;
bounds.Width = len;
if (Equals(true, e.Cell.Value))
{
ControlPaint.DrawCheckBox(e.Graphics, bounds, ButtonState.Checked | ButtonState.Flat);
}
else if (Equals(false, e.Cell.Value))
{
ControlPaint.DrawCheckBox(e.Graphics, bounds, ButtonState.Normal | ButtonState.Flat);
}
else
{
ControlPaint.DrawCheckBox(e.Graphics, bounds, ButtonState.Normal | ButtonState.Inactive | ButtonState.Flat);
}
}
public override void EditCell(IGridEditorService service, Cell cell)
{
object value = cell.Value;
cell.Value = !Equals(true, value);
}
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.None;
}
} |
See Also