Click here to Skip to main content
16,012,168 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,
Offline we are having only one gridview .we want to generate no. of grids at runtime whom values are there in dropdown.
Posted
Updated 7-Aug-12 1:42am
v2

1 solution

Creating gridview at runtime

C#
DataGridView()dataGrid=new DataGridView();
this.Controls.Add(dataGrid);
dataGrid.DataSource =//some datatable or dataset based on your business


To generate rows at run time, check this.

http://sahapankaj.blogspot.in/2009/04/create-row-at-run-time-in-aspnet.html[^]

also this.
http://blog.falafel.com/blogs/mike-dugan/2007/04/12/Dynamically_add_rows_to_a_GridView[^]
 
Share this answer
 
v3
Comments
Member 8921522 7-Aug-12 7:57am    
but we also create rows or data table at run time in grid view
Santhosh Kumar Jayaraman 7-Aug-12 7:58am    
updated solution.refer http://sahapankaj.blogspot.in/2009/04/create-row-at-run-time-in-aspnet.html
Member 8921522 7-Aug-12 8:13am    
http://sahapankaj.blogspot.in/2009/04/create-row-at-run-time-in-aspnet.html
Here no. of rows generate at run time but mujhe utne grid runtime per generate karane hai jitni values mere pass dropdownlist me hai or un grids me auto column bhi generate karane hai??
Santhosh Kumar Jayaraman 7-Aug-12 8:14am    
Why cant u post it in English here?
Santhosh Kumar Jayaraman 7-Aug-12 8:16am    
sorry i dont know hindi

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900