What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 26629 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > How to get checkbox value in gridview ...
Oswaldlily

How to get checkbox value in gridview

Replies: 5 | Posted by: Oswaldlily on 5/30/2012 | Category: ASP.NET Forums | Views: 4995 | Status: [Member] | Points: 10  


even if my checkbox checked insde gridview this condtion not satisfying means not enterin if loop.
what could be reason.Is it correct way to get checkbox id in gridview
public void name()
{
foreach (GridViewRow g in ((GridView)(Session["gview"])).Rows)
{
if (((CheckBox)g.FindControl("chkSelect")).Checked==true)
{
str1 = ((System.Web.UI.WebControls.Label)g.FindControl("lbl1")).Text;
str2 = ((System.Web.UI.WebControls.Label)g.FindControl("lbl2")).Text;
i++;
}
}
}


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Vforvijay
Vforvijay  
Posted on: 5/30/2012 5:36:10 AM
Level: Starter | Status: [Member] | Points: 25

Oswaldlily, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Ajay.Kalol
Ajay.Kalol  
Posted on: 5/30/2012 6:12:05 AM
Level: Starter | Status: [Member] | Points: 25

check it by putting break point,
check that why if condition getting false.

you will find your solution

http://ajaypatelfromsanthal.blogspot.in

Oswaldlily, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Chikkanti
Chikkanti  
Posted on: 5/31/2012 12:34:53 AM
Level: Starter | Status: [Member] | Points: 25

Oswaldlily, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Muhsinathk
Muhsinathk  
Posted on: 6/12/2012 4:30:34 AM
Level: Bronze | Status: [Member] | Points: 25

Oswaldlily, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Shanky11
Shanky11  
Posted on: 3/6/2013 1:46:54 AM
Level: Starter | Status: [Member] | Points: 25

i need this in vb.net windows app
datagriedview

Oswaldlily, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/22/2013 7:53:16 AM