Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have created a dynamic gridview in asp.net3.5 with dynamic rows and columns using my SQL 2008 database.

I am trying to have to use find control method to find textbox's to insert the data into the database. I am not using edit item template.

Does anyone of you can hep me with my query?

i have used
http://www.codeproject.com/KB/aspnet/create_template_columns.aspx[^]
Posted
Updated 6-Dec-10 0:23am
v3
Comments
Dalek Dave 6-Dec-10 6:21am    
Edited for Grammar and Readability.

TextBox TxCity = (TextBox)GrvCity.Rows[e.RowIndex].Cells[0].Controls[0];
TextBox txtState= (TextBox)GrvCity.Rows[e.RowIndex].Cells[1].Controls[0];
and
so on
Here Cells[0] means first item of gridview
Cells[1] second column and so on ..

Use it it works
 
Share this answer
 
Comments
Sandeep Mewara 6-Dec-10 12:58pm    
Comment from OP:
Thanks Wasif for your answer
but i am not using gridevent args method
iam doing everything in a showgrid() method
i just want to find the controls in the gridview and insert them into the database i dont have an button in the gridview, i want to insert the records via the button on to my page.
Moin 10918476 2-Jul-14 3:26am    
how to find find dynamic control by cell number in gridview
Thanks Wasif for your answer
but i am not using gridevent args method
iam doing everything in a showgrid() method
i just want to find the controls in the gridview and insert them into the database i dont have an button in the gridview, i want to insert the records via the button on to my page.
 
Share this answer
 
Comments
Sandeep Mewara 6-Dec-10 12:58pm    
Not an answer. Use 'Add Comment' feature
Alper Hankendi 26-Jan-11 14:16pm    
I suggest use flexigrid. http://www.codeproject.com/KB/aspnet/FlexiGrid.aspx

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