Use Below Code :
protected void Butshow_Click(object sender, EventArgs e)
{
DateTime datefrom = DateTime.Parse(Textfrom.Text);
DateTime dateto = DateTime.Parse(Textto.Text);
inp.plandatefrom = datefrom;
inp.plandateto = dateto;
dt = inp.gridshow();
GridView1.DataSource = dt;
GridView1.DataBind();
var mainGrid = new DataTable();
mainGrid.Columns.Add("Count");
foreach (DataRow row in dt.Rows)
{
DataTable grid = new DataTable();
inf.plandat = DateTime.Parse(row[0].ToString());
grid = inf.gridshowfor();
foreach (DataRow dr in grid.Rows)
{
if (dr != null && dr[0] != null)
{
var mainRow = mainGrid.NewRow();
mainRow["Count"] = dr[0];
mainGrid.Rows.Add(mainRow);
}
}
GridView2.DataSource = mainGrid;
GridView2.DataBind();
}
}