OnClick using CustomObjectAttribute for checkbox column does not get called

3 replies. Last post: May 21, 2010 1:20 PM by Handy Surya
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hello,

I am using Webgrid 7. The grid has a check box column, and I am wanting to attach a client side "onclick" java script function for the check box column.

I have been through the examples in the forum, and have tried using

e.Row.Cells.GetNamedItem("CheckBoxColumn").CustomObjectAttributes = "onclick = 'return CheckForMultipleExclude(this);'";

But the problem is that with the above code, I can see in the rendered HTML, there is a tag added for "onclick='return CheckForExclude(this)' for each of the checkboxes in the column, however, the javascript function does not get called. Instead if I delete the existing onCLick setting and re add exacty the same using firebug, or IE developer toolbar, javascript function is invoked.

 

Instead, if I use e.Row.Cells.GetNamedItem("CheckBoxColumn").CustomAttributes = "onclick = 'return CheckForMultipleExclude(this);'";, it works perfectly , but this gets called also for the entire 'td' within which the checkbox is rendered.

 

Kindly help me.

Thanks

DHaval.

e.Row.Cells.GetNamedItem("CheckBoxColumn").CustomAttributes = "onclick = 'return CheckForMultipleExclude(this);'";, it works perfectly , but this gets called also for the entire 'td' within which the checkbox is rendered.

 

Kindly help me.

Thanks

DHaval.

All times are GMT -5. The time now is 4:23 PM.
Previous Next