Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to make checkbox checked depending on the database value in gridview
C#

Posted
Updated 11-May-13 19:59pm
v2

1 solution

Get the database values using a datareader.
Loop through the returned records and then write code similar to the following -

if (dr["colName"] == "Yes")
{
   ckBox.Checked = true;
}
else
{
   ckBox.Checked = 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