Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#3.0 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 2: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
0 Maciej Los 404
1 OriginalGriff 379
2 CPallini 145
3 Sergey Alexandrovich Kryukov 142
4 Hard_Rockz 115
0 OriginalGriff 5,634
1 Sergey Alexandrovich Kryukov 4,763
2 Peter Leow 2,954
3 Maciej Los 2,614
4 DamithSL 2,465


Advertise | Privacy | Mobile
Web01 | 2.8.140718.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid