Click here to Skip to main content
16,016,759 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
CheckBox chk = grdAssign.Rows[i].Cells[0].FindControl("chkStatus") as CheckBox;
if (chk.Checked==true)
{
    clsProjectBO objProject = new clsProjectBO();
    objProject.Project_Name = grdAssign.Rows[i].Cells[1].Text;
}

I got the check obx but it get checked value always false so give me suggestion.
Posted
Updated 6-Jun-13 18:30pm
v2
Comments
Nandakishore G N 7-Jun-13 0:41am    
paste the complete code. with this information it cannot be judged.

This means that your GridView is rebinding again n again in every postback. Use if(!IsPostBack){....} code block under Page_Load event to bind your GridView. Try this:
C#
protected void Page_Load(object sender, EventArgs e)
{
    if(!IsPostBack) 
    {
       //Bind your gridview here
    }
}
 
Share this answer
 
Comments
Siddharth Ghule 7-Jun-13 2:43am    
thanx it works
_Amy 7-Jun-13 2:46am    
Welcome. :)
I suspect that you are binding the data at the time of page load event. If this is so, put the relevant code inside

C#
if(!IsPostBack) 
{
   //code goes here
}


that would be helpful for you.

Regards... :)
 
Share this answer
 
v2
Comments
Siddharth Ghule 7-Jun-13 2:43am    
Thnax its work
Siddharth Ghule 7-Jun-13 3:04am    
ok
Siddharth Ghule 7-Jun-13 3:27am    
ok i understand actually this is first time to ask que on this site

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