CODE :
DataRow dr;
DataSet ds = new DataSet();
ds.Tables.Add("DGStandIn");
ds.Tables["DGStandIn"].Columns.Add("ID",typeof(int));
//dgVanity is the datagrid name
for(int i = 0; i < nos; i++)
{
dr = ds.Tables["DGStandIn"].NewRow();
dr[0]=i;
ds.Tables["DGStandIn"].Rows.Add(dr);
}
dgVanity.DataSource = ds.Tables["DGStandIn"];
dgVanity.DataBind();
///////////////////// to loop through the datagrid items
foreach(DataGridItem i in dgVanity.Items)
{
if(((RadioButton)(i.FindControl("controlname"))).Checked)
{
//actions here
}
}
0 comments:
Post a Comment