Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a gridview with checkbox inside asp:TemplateField. I wish to select multiple checkboxes and on button click I want to add those selected rows in another page which consists of the repeater.Also I want to give the ability to the user to select a single row when any of the row is clicked.

My problem is when I click any of the checkbox,the rowcommand gets fired and one record gets added to the repeater.
I wish to prevent this rowcommand event to get fired when checkbox is checked/unchecked.

Kindly guide me on this issue.
Thanks.
Posted
Comments
walterhevedeich 10-Feb-12 3:54am    
Can you post the tags inside the TemplateField? I just tried putting a checkbox inside a TemplateField and ticked it but the RowCommand event never got triggered.
Warreer 10-Feb-12 5:14am    
<asp:TemplateField>
<HeaderTemplate>
<input type="checkbox" runat="server" id="CheckHeader" />
</HeaderTemplate>
<HeaderStyle CssClass="FixedHeader" />
<itemtemplate>
<input type="checkbox" runat="server" id="ChkBox" />

Warreer 10-Feb-12 5:38am    
Can you also make sure that you have defined the rowcommand event ?

Hi,
Please give autopostback property set to false and then try it.
 
Share this answer
 
Comments
Warreer 10-Feb-12 7:59am    
I tried that already, but did not work.
check this link
http://stackoverflow.com/questions/9224657/how-to-stop-rowcommand-event-from-getting-executed-in-a-gridview

Hope it helps you!
 
Share this answer
 

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