Click here to Skip to main content
15,943,749 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I created a grid view in ASP.Net which has a template field, i save the data from grid view into the database, but how can i retrieve the save data into the grid view becoz in template field no option for data field.

Please do the needful.

Thanks
Basit.
Posted

1 solution

but how can i retrieve the save data into the grid view becoz in template field no option for data field.
Once data is saved in field, why do you worry of grid? You have table with columns and rows in database. Fetch the data using ADO.NET using some query.

In case, you want to bind a datatable column to grid having template fields, see this:
MSDN: Using TemplateFields in the GridView Control[^]
MSDN: Creating a Custom Column in a GridView Web Server Control[^]
MSDN: TemplateField.ItemTemplate Property[^]
 
Share this answer
 
Comments
basitsar 16-Jun-12 7:48am    
Dear Sandeep,

Thanks for your prompt reply. I created a template field where you can edit a data in a multiple rows without click on edit button there is no boundfield then how retrieve from database?

Thanks
Basit.
Sandeep Mewara 16-Jun-12 9:02am    
Read my answer again. Just to retrieve data from database, you don't need a grid or a bound field.

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