datagrid and checkbox in asp.net

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Hi, all:

I have a datagrid in a web form, then I added a check box for each row. Also I
have a "submit" button at the bottom of the page. Now, when user click "submit"
button, how can I know which row(s) user has checked?

Thanks in advance.
 
how about something like this

for(int i =0; i < myDataGrid.items.count; i++)
{
(CheckBox) myCheckBox =
(CheckBox)myDataGrid.Items.FindControl("UserCheck");
if(myCheckBox.check == true)
{
// do something here
}
else
{
// do something else if you wish to
}
}

sorry for any syntax errors.. i am dont have vs.net on this machine to give
you syntax free code snippet.

HTH

Hermit Dave
 
Back
Top