Click here to Skip to main content
15,895,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good Afternoon to all.

I would like to know the code to enter data from existing textboxes to a DataGrid(or GridView) in a form at run time. I don't get any data from Database to fill the DataGrid.

If I need to explain more clearly in my form I have placed 10 textboxes which can be filled by the values from database when I select an Item in DropdownList. now when I click a button to view these details as a table all these textboxes content to be added to the dataGrid. and also I would like to know the code for Adding Some other text which cannot be from textboxes, but can be obtained from my code at run time.

Please any one help me.

Thanks in advance

ganesh
Posted

1 solution

You need some datasource to bind your gridview. Normally datasource comes from database or some file system.

Might be you hve some different requirement. You can get all the data from your textboxes and have then is datasource like datatable etc and bind it to gridview.

If you want to format or change something in grid dynamically then implement rowdatabound event of gridview
 
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