How to Programmatically create a DataGrid

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I use the code to create a DataGrid and filled with data,
But the DataGrid1 didn't display in WebForm.
How can I display the DataGrid after creating it?



DataGrid DataGrid1 = new DataGrid();
 
Well, its the first block of sample code on the first page.

Just scroll down and it's right there.

If you can't understand that, then you need to really do some basic reading
in .Net before asking these kinds of questions.
 
Thanks,
You mean the line:
<asp:datagrid runat="server" id="ID_of_DataGrid" />


It is design time created DataGrid, but I wnat to know how to create it
dynamically!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top