Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi guys ,

I am new to asp.net, i am sure my problem might be pretty simple ,

I am creating two check box columns in a grid view.What i want is user can only check
only one column in each row ,i want to show a message if a user selects both,i want to handle it at client side no post back to server, any help ?

regards,
Posted

 
Share this answer
 
You can use a Template column to add the checkboxes and a JavaScript handler for the change event. Or you could add the event handlers after rendering using JavaScript. JQuery would be very helpful in both cases.
 
Share this answer
 
Yes, I am agree with Mark. You can do it either of Client or Server side. Put the checkbox in Template Field. If you want to do it in server side scripting, Read the CheckBox value from GridViewRow using FindControl Methods. I will suggest for Javascript / JQuery . Attach a Script handler while binding with row . That will make thing very simple.
 
Share this answer
 
Comments
Tauseef A 13-Aug-11 16:24pm    
i am using a template column, can you please provide me with the helping code ?
regards.

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