Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Question 1: How to bind data to auto generated columns in gridview in asp.net
In My gridview we cannot using Eval and bind function , I created columns dynamically, so please solve problem.

Question2: When i Click edit button on gridview it removes default textbox and place to dropdown list with data,Don't use Eval and bind methods Please help me
Posted

1 solution

Sounds like you need to build grid columns dynamically and also have edit/update kind of feature. If so, you need to build TemplateFields too at runtime.

A TemplateField object enables you to specify templates that contain markup and controls to customize the layout and behavior of a column in a GridView control. Using an ItemTemplate, you can specify the layout to be used when the GridView displays data in a column.

Refer:
Dynamic Template Columns in the ASP.NET 2.0 GridView Control[^]
 
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