Hello friend, You may try something like this:
Add a
PlaceHolder
control on your page where you want to display the control dynamically:
<asp:placeholder id="PlaceHolder1" runat="server" xmlns:asp="#unknown"></asp:placeholder>
Write the following code behind:
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("~/XMLFile1.xml"));
GridView gv = new GridView();
gv.DataSource = ds;
gv.DataBind();
PlaceHolder1.Controls.Add(gv);