M_K_Higa 2 Junior Poster

I want to surround the html results from a GridView control with a <fieldset> tag. I need to do this on the server side.

I have a situation where I need to build multiple GridView controls during runtime because I don’t know how many data sets I need during design time. This is relatively easy to do; here’s some pseudo code explaining how I create multiple GridView controls on the fly…

//Each iteration creates a new GridView and adds it to a Panel control.
//Number of iterations are not known until runtime.
GridView gv;
foreach(something in aContainer) {
  gv = new GridView();//Instantiate new GridView in each iteration

  //  Do some Stored Procedure 
  //  preparation work here.
  gv.DataSource = cmdObj.ExecuteReader();//Execute the proc and then...
  gv.DataBind();// ... bind it to the GridView
  //  After populating the GridView control
  //  we added it to a Panel so it gets 
  //  displayed on the web page

  pnlGridHolder.Controls.AddAt(0, gv);//Add GridView to a predefined Panel control
}

In the code above, how do I surround each [inlinecode]GridView[/inlinecode] with a [inlinecode]<fieldset>[/inlinecode] tag?

Thanks!

-Mike