mfawn
unread,Nov 5, 2009, 8:04:48 PM11/5/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
I have a gridview that I have added some checkboxes too. I have a
foreach loop that is returning if a checkbox has been clicked but I
also need to pull back one of the colums in that row so I know what
category is clicked.
EG:
Row 1 has a category id of 3 and checkbox is unchecked.
Row 2 has a category id of 12 and checkbox is unchecked.
Row 3 has a category id of 23 and checkbox is checked.
Row 4 has a category id of 54 and checkbox is unchecked.
I can get that the row 3 is checked but I can't get back the category
id to add it to the database.
I'm trying something like this:
foreach (GridViewRow di in GridView1.Rows)
{
CheckBox chkBx = (CheckBox)di.FindControl("ShowAddress");
if (chkBx != null && chkBx.Checked)
// add DB code here
}