Click here to Skip to main content
13,298,551 members (39,020 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Question 1: How to bind data to auto generated columns in gridview in
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 18-Feb-13 3:12am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

Dynamic Template Columns in the ASP.NET 2.0 GridView Control[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171207.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100