Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programmatically Adding DataGrid and Specifying the location. 1

Status
Not open for further replies.

ceyhorn

Programmer
Nov 20, 2003
93
US
I am programmatically adding a datagrid to my page on a selected index change event. It is working just fine, but it put the datagrid at the far bottom of the screen. Is there a way to add a place holder and specify where to add the datagrid? Thanks in advance,

Chris
 
Yes, you can place a PlaceHolder control on the page and load your DataGrid into it, in exactly the same way you add it now to the page.
Code:
html:
<asp:PlaceHolder id="plGrid" runat=server />

code behind:
DataGrid dg = new DataGrid();
plGrid.Controls.Add(dg);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top