i was wondering if there IS a way to loop thru a datagrid?
im trying to loop thru a datagrid to see which checkboxes were checked and which werent
and if the checkbox is checked its added to this second datagrid that is on the page
Printable View
i was wondering if there IS a way to loop thru a datagrid?
im trying to loop thru a datagrid to see which checkboxes were checked and which werent
and if the checkbox is checked its added to this second datagrid that is on the page
Can you please specify that this is a Web app when it's a Web app so people know?
yeah sorry its a web app and im using VS 2003 c#
Loop through the datagrid's items collection.
Code:foreach( DataGridItem dgi in dg.Items )
{
HtmlInputCheckBox chkBox = (HtmlInputCheckBox)dgi.FindControl("YourCheckBoxId") ;
if( chkBox !=null && chkBox.Checked )
{
//Ta daaaa!
}
}