Hi Telerik,
I noticed that, there is no "VirtualGridCheckBoxEditor" class. Not sure why. So I decided to create a check box editor by following Telerik's documented approach. See the code below which is my checkbox editor. However, the checkbox, when the cell is in edit stage, is not rendered at the center of the cell element (see attachment checkboxeditornotcenter.png).
Please assist.
Thank you,
Saj.
------------------------Code--------------------------------------------------------------
public class CoreVirtualGridCheckBoxEditor : BaseVirtualGridEditor
{
protected override Telerik.WinControls.RadElement CreateEditorElement()
{
var elmnt = new RadCheckBoxElement();
return elmnt;
}
public override void Initialize(object owner, object value)
{
base.Initialize(owner, value);
}
public override void BeginEdit()
{
base.BeginEdit();
}
public override Type DataType
{
get
{
return typeof(bool);
}
}
public override object Value
{
get
{
RadCheckBoxElement editor = this.EditorElement as RadCheckBoxElement;
if (editor.CheckState== System.Windows.Forms.CheckState.Checked)
{
return true;
}
return false;
}
set
{
RadCheckBoxElement editor = this.EditorElement as RadCheckBoxElement;
if (value == null || value.GetType() != typeof(bool))
{
editor.CheckState = System.Windows.Forms.CheckState.Unchecked;
return;
}
bool val = (bool)value;
editor.CheckState = val ? System.Windows.Forms.CheckState.Checked : System.Windows.Forms.CheckState.Unchecked;
}
}
}