We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

CheckBoxClick Event

Hi, I have a GDBG with a checkbox column which will be disabled depends on a value on another column. In the PrepareViewStyle, I have disabled the Checkbox Column bye e.Style.Enabled = false;
However, the CheckBoxClick event are still firing even though I have the checkbox column disabled. Is there a way to fix it? Thanks. Am I missing something?

4 Replies

AD Administrator Syncfusion Team August 22, 2006 10:22 AM UTC

By the way, I am using 3.3 and also I have tried e.Style.Clickable = false in PrepareViewStyle but still no luck.

Thanks.

>Hi, I have a GDBG with a checkbox column which will be disabled depends on a value on another column. In the PrepareViewStyle, I have disabled the Checkbox Column bye e.Style.Enabled = false;
However, the CheckBoxClick event are still firing even though I have the checkbox column disabled. Is there a way to fix it? Thanks. Am I missing something?


AD Administrator Syncfusion Team August 22, 2006 10:42 AM UTC

Hi Kai,

I have created the sample as per your requirement. Attached sample works fine with the GridCheckBoxCell disable mode in a Grid and let me know if you are looking something different.

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/CheckBoxValidation_28ba1acb.zip

If you can send us a sample that does not work, we can try to debug it here.

Regards,
Haneef


AD Administrator Syncfusion Team August 23, 2006 01:32 AM UTC

Haneef, thanks for your sample. However, your sample still fails because the this.gridDataBoundGrid1.CheckBoxClick event will still get fired even though the CheckBox is disabled.

kai

>Hi Kai,

I have created the sample as per your requirement. Attached sample works fine with the GridCheckBoxCell disable mode in a Grid and let me know if you are looking something different.

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/CheckBoxValidation_28ba1acb.zip

If you can send us a sample that does not work, we can try to debug it here.

Regards,
Haneef


AD Administrator Syncfusion Team August 23, 2006 05:12 AM UTC

Hi Kai,

Sorry for the inconvenience caused.

You would have to derive the GridCheckBoxCellRenderer and override OnHitTest method. Please refer the attached sample for more details and let me know if this helps.

protected override int OnHitTest(int rowIndex, int colIndex, MouseEventArgs e, Syncfusion.Windows.Forms.IMouseController controller)
{
//To assign the Enabled/Clickable property of style object using QueryCellInfo event.
//Bcoz QueryCellInfo is used to store style property in a cell. PrepareViewStyleInfo for visualization setting.
if( this.Grid.Model[rowIndex,colIndex].Enabled || this.Grid.Model[rowIndex,colIndex].Clickable )
return base.OnHitTest (rowIndex, colIndex, e, controller);
else
return 0;
}

Here is a modified sample.
http://www.syncfusion.com/Support/user/uploads/CheckBoxValidation_42c20b54.zip

Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon