Monday, April 5, 2010

to show the nested grid

l1 = (LinkButton)GridView1.Rows[GridView1.Rows.Count].FindControl("Label1");



GridView childgrid = (GridView)GridView1.Rows[1].Cells[3].Controls[1];

SqlDataAdapter sqlDa = new SqlDataAdapter("select * from dept where branchno='" + l1.Text + "'", con);
DataSet ds = new DataSet();
sqlDa.Fill(ds);
childgrid.DataSource = ds;
childgrid.DataBind();