Click here to Skip to main content
12,623,511 members (29,841 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#3.0 C# ASP.NET
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 18-Feb-13 3:12am

1 solution

Rate this: bad
 
good
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.

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

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 | Mobile
Web02 | 2.8.161128.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2016
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