How to handle the onchange(checked, unchecked event ) of checkbox column in Grid

Dear Team,

Request you to let me know how we can handle onchange event of checkbox type column in Grid of Syncfusion ASP.NET Web Forms.

Below is the sample code, Let me know the event which should be called when the checkbox is checked or unchecked.
<ej:Grid ID="GridMatterDisplay" runat='server' AllowSorting="true" AllowMultiSorting="true" AllowPaging="false" AllowFiltering="true" AllowTextWrap="true" AllowResizing="true" AllowResizeToFit="true" AllowScrolling="true" GridLines="Horizontal" EnableAltRow="false" IsResponsive="true">
                    <TextWrapSettings WrapMode="Both" />
                    <FilterSettings FilterType="Menu" FilterBarMode="Immediate"></FilterSettings>
                    <ScrollSettings Width="1200" />
                    <SelectionSettings SelectionMode="Cell" />
                    <Columns>
                        <ej:Column Type="checkbox" HeaderText="" Width="3%" AllowSorting="false" TextAlign="Left" AllowFiltering="false"></ej:Column>


Thanks & Regards,
Venkatesh Yellaboyina

1 Reply 1 reply marked as answer

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team February 3, 2021 10:50 AM UTC

Hi Venkatesh, 

Thanks for contacting Syncfusion Support. 

Query#:- Let me know the event which should be called when the checkbox is checked or unchecked. 
 
We have checked your query and while on Checkbox selection with checkbox check/uncheck actions RowSelected  and RowDeselected event will trigger.   Refer to the below code:- 
<ej:Grid ID="OrdersGrid" runat="server" AllowPaging="True" Selectiontype="Multiple"> 
       <ClientSideEvents RowSelected="rowSelected"  RowDeselected="rowDeselected" /> 
            <Columns> 
                <ej:Column Type="checkbox" Width="50" /> 
                <ej:Column Field="OrderID" HeaderText="Order ID" TextAlign="Right" Width="90" /> 
                  
            </Columns> 
        </ej:Grid> 
       <script> 
           function rowSelected(args) { 
                 // do your stuff here 
           } 
           function rowDeselected(args) { 
               // do your stuff here 
           } 
       </script> 


Refer to the API Links:- 

For additional information we have placed the checkbox as Template and performed Selection with change event of ejCheckBox. Refer to the below KB link:- 

You can use anyone of the above solutions to achieve your requirement. Please get back to us if you are facing any difficulties on this. 

Regards, 
Farveen sulthana T 


Marked as answer
Loader.
Up arrow icon