DataGrid dg = e.Item.FindControl("DataGrid1") as DataGrid; if (dg != null) { dg.DataSource = dataSet2.Tables[0].DefaultView; dg.DataBind(); }