G
GaryDean
I'm trying to load a GridView up with data manually, in code. I'm not using
any datasource. Using this code....
ArrayList myRowArrayList;
GridViewRow myGVR = new GridViewRow(0,0,DataControlRowType.DataRow,
DataControlRowState.Normal);
TableCell myCell = new TableCell();
TextBox myTextbox = new TextBox();
myTextbox.Text = "hello world";
myCell.Controls.Add(myTextbox);
myGVR.Cells.Add(myCell);
myRowArrayList.Add(myGVR);
GridViewRowCollection myCollection = new
GridViewRowCollection(myRowArrayList);
//How do I attach this collection to my GridView?
I can't see how to add the new row I created to the GridView. There is no
GridView.rows.add method. How is a row added to a gridview or how is the
GridViewRowcollectin attached to the Gridview?
any datasource. Using this code....
ArrayList myRowArrayList;
GridViewRow myGVR = new GridViewRow(0,0,DataControlRowType.DataRow,
DataControlRowState.Normal);
TableCell myCell = new TableCell();
TextBox myTextbox = new TextBox();
myTextbox.Text = "hello world";
myCell.Controls.Add(myTextbox);
myGVR.Cells.Add(myCell);
myRowArrayList.Add(myGVR);
GridViewRowCollection myCollection = new
GridViewRowCollection(myRowArrayList);
//How do I attach this collection to my GridView?
I can't see how to add the new row I created to the GridView. There is no
GridView.rows.add method. How is a row added to a gridview or how is the
GridViewRowcollectin attached to the Gridview?