Click here to Skip to main content
15,923,168 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have a gridview with 4 columns.4th column is checkbox.3rd is status.I want to disable the checkbox if status is no
Posted
Comments
What have you tried? Where is the problem?

C#
CheckBox chk=new CheckBox();
chk = (CheckBox)grdAssign.Rows[i].FindControl("your checkbox column name");
chk.Enabled = false;
 
Share this answer
 
v2
try this...:)

C#
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
   {
       if (e.Row.RowType == DataControlRowType.DataRow)

       {

           CheckBox chkBox= (CheckBox)e.Row.FindControl("chkbox1");

           if(e.Row.Cells[2].ToString()=="no")
                {

                    chkBox.Checked=false;

                }

       }

   }
 
Share this answer
 
Comments
16Sonali 4-Jul-13 7:37am    
Thanks a lot
Nirav Prabtani 4-Jul-13 7:44am    
Please up vote it if it solves your problame.

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