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.
Unfortunately, activation email could not send to your email. Please try again.

CheckBoxClick Event

Thread ID:

Created:

Updated:

Platform:

Replies:

48194 Aug 22,2006 06:20 AM Aug 23,2006 01:12 AM Windows Forms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On August 22, 2006 06:20 AM

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?

Administrator [Syncfusion]
Replied On August 22, 2006 06:22 AM

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?

Administrator [Syncfusion]
Replied On August 22, 2006 06:42 AM

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

Administrator [Syncfusion]
Replied On August 22, 2006 09:32 PM

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

Administrator [Syncfusion]
Replied On August 23, 2006 01:12 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;