Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

am working on asp.net project using C#.

on my webpage i have gridview with checkboxes within item template, user must able to select only one checkbox, not more than one.

If user select that particular row with checkbox, the row of that background color must change.

Note : Highlight the gridview row, if checkbox selected in gridview.
User can select only one checkbox

Please can you help me, thanks in advance.
Posted
Updated 11-May-16 20:40pm

Good article of Walter. Instead of checking all checkboxes you can disable them preventing other choices or, if you want so, uncheck all other choices in this method
 
Share this answer
 
1. in gridview checkbox control must have ID

2. set check box property autopostback is true;

3. in gridview RowCommand when used check on checkbox update your database field value for checkbox
using commandargument and commandname

4 In grid view rowdatabound event define controls one for checkbox and other for label or textbox
in which your database table primary key value bind
now again there access record for that primary key

and check value through "if condition"
and place if true then checkbox1.checked=true; else false;
 
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