A checkbox editor to edit boolean values in cells.

Namespace: Dapfor.Net.Editors
Assembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)

Syntax

C#
public class CheckBoxEditor : UITypeEditorEx
Visual Basic
Public Class CheckBoxEditor
	Inherits UITypeEditorEx
Visual C++
public ref class CheckBoxEditor : public UITypeEditorEx
F#
type CheckBoxEditor =  
    class
        inherit UITypeEditorEx
    end

Examples

Demonstrates how to declare the CheckBoxEditor to edit values in Cells
 Copy imageCopy
//Some data object with boolean Properties
public class Product
{
    private bool active;
    private bool tradable;

    //Declare the CheckBoxEditor for this property. Each Grid will use this editor to edit values in cells
    [Editor(typeof(CheckBoxEditor), typeof(UITypeEditor))]
    public bool Active
    {
        get { return active; }
        set { active = value; }
    }

    //The CheckBoxEditor may be declared in the Column 
    public bool Tradable
    {
        get { return tradable; }
        set { tradable = value; }
    }
}

//Initialize the grid
public void AddDataObjectToGrid(Grid grid)
{
    //Configure the headers
    grid.Headers.Add(new Header());
    grid.Headers[0].Add(new Column("Active"));
    grid.Headers[0].Add(new Column("Tradable"));

    grid.Headers[0]["Active"].Editable = true;
    grid.Headers[0]["Tradable"].Editable = true;
    //Declare the editor only for the current grid
    grid.Headers[0]["Tradable"].Editor = new CheckBoxEditor();

    //Add a data object
    grid.Rows.Add(new Product());
}

Inheritance Hierarchy

See Also