Click here to Skip to main content
15,848,415 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a GridView in aspx page like this

ASP.NET
<asp:GridView ID="GridView1" runat="server" DataKeyNames="key" OnRowDataBound="OnRowDataBound"
OnRowEditing="OnRowEditing" OnRowCancelingEdit="OnRowCancelingEdit" OnRowUpdating="OnRowUpdating"
OnRowDeleting="OnRowDeleting" EmptyDataText="No records has been added." AutoGenerateEditButton="true"
ShowHeaderWhenEmpty="true" AutoGenerateDeleteButton="true"  AutoGenerateColumns="true">
    <Columns>

    </Columns>
</asp:GridView>


Now in the dataSource I have a boolean field. On clicking edit button as usual I am getting a checkbox for that field. How to write some code in the checkchanged event of that checkbox?

What I have tried:

OnRowDataBound, OnRowEditing, OnRowCancelingEdit, OnRowUpdating, OnRowDeleting events are working fine.

But unable to implement the checkchanged event as no checkbox control is used either in ItemTemplate or in Edit Itemtemplate.

the dataSource have too many columns. That is why I wanted to avoid writing all the columns specifically in Itemtemplates
Posted
Comments
Karthik_Mahalingam 28-May-16 0:21am    
Not possible, unless you write Item Template, EditItemTemplate

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900