Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Please I need to create a dynamic datatable such that
1st row ("Department name",textbox,regular expression validation)
2nd row ("city name", drop down list, required field validation)
3rd row...so on to be inserted manually

What I have tried:

I tried thus tutorial with edit but I failed
https://www.aspsnippets.com/Articles/Adding-Dynamic-Rows-in-ASP.Net-GridView-Control-with-TextBoxes.aspx[^]
Posted
Updated 27-Oct-19 15:54pm
Comments
MadMyche 24-Oct-19 22:28pm    
Normally the headings go across; in columns, such as that demo you refer to.
ZurdoDev 25-Oct-19 7:08am    
What is your question?
Kornfeld Eliyahu Peter 27-Oct-19 10:40am    
The kind of data structure you describe here (or at least as I understand what you describe here) is pretty hard to crate in a single DataTable (as it was modeled for relational DB)... You may look for what they call document base...
Or alternatively clarify your question with possible code sample and explanation what exactly went wrong...

1 solution

Quote:
I tried thus tutorial with edit but I failed


I wrote the tutorial you mentioned a long time ago. I've published a new article and put together editing and saving of records here: Dynamically Adding and Deleting Rows in GridView and Saving All Rows at Once[^]

That should help you get started. Please note that if you have a different structure within your TemplateField column, you need to debug your code so you will know how to reference the controls within the grid.
 
Share this answer
 

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