Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
730
TemplateDataField checkbox client side click
posted

Hello,

I'm using VS2010 with 10.3 release. I have a webdatagrid with a template and a checkbox inside. I set the onclick event for the checkbox but it never fires. I tried to catch the cellvalue changing event and check for the column key but that didn't work either.

How can I have a client side event for the checkbox to perform some validation on it if it's checked/unchecked. I want to be able to check it only if another cell was edited and has values in it. If it doesn't then cancel or return flase and the check is cleared.

here's my checkbox code:

<ItemTemplate>
    div style="text-aligncenter;">
        asp:CheckBox ID="CheckSpecific" runat="server" 
                     AutoPostBack="true" 
                     Checked='<%# Bind("IsSpecific") %>' 
                     OnCheckedChanged="CheckSpecific_CheckedChanged" />
    div>
ItemTemplate>

Thanks,