Posted 29 March 2018, 8:43 am EST - Updated 4 October 2022, 2:55 am EST
Hi,
I’d like to disable the checkbox that appears in flexgrid, when i’m editing the field, as shown in the attach image.
How can I do that?
Thanks in advanced,
Forums Home / ComponentOne / WinForms Edition
Posted by: mysql.jorge on 29 March 2018, 8:43 am EST
Posted 29 March 2018, 8:43 am EST - Updated 4 October 2022, 2:55 am EST
Hi,
I’d like to disable the checkbox that appears in flexgrid, when i’m editing the field, as shown in the attach image.
How can I do that?
Thanks in advanced,
Posted 1 April 2018, 11:59 pm EST
Hello,
To hide the checkbox shown beside the date value, you may use C1FlexGrid’s SetupEditor event and set the ShowCheckBox property to false as follows:```
private void C1FlexGrid1_SetupEditor(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
{
var editor = c1FlexGrid1.Editor;
(editor as DateTimePicker).ShowCheckBox = false;
}
Ruchir Agarwal
Posted 4 April 2018, 3:29 am EST
Hi Jorge,
personally, I prefer using the “C1.Win.Calendar.C1DateEdit” component as editor for datetime values, because it is better to use (e.g. you can type-through the date value):
You have to add references to “C1.Win.Calendar.4.dll” and “C1.Win.C1Input.4.dll”.
Declare a member variable:
private C1.Win.Calendar.C1DateEdit c1DateEdit;
After the grid is created, apply the editor:
this.c1DateEdit= new C1.Win.Calendar.C1DateEdit();
this.c1FlexGrid.Cols[xyz].Editor = c1DateEdit;
don’t forget to dispose it:
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
if (disposing)
{
if (this.c1DateEdit!= null)
{
this.c1FlexGrid.Cols[xyz].Editor = null;
this.c1DateEdit.Dispose();
this.c1DateEdit= null;
}
}
base.Dispose(disposing);
}
Best regards
Wolfgang