View Single Post
  #4 (permalink)  
Old January 16th, 2011, 10:38 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts

but, when I tried to create a template field in the edit columns view, I got an empty properties dialog in that window,
Yes, correct. When you create a TemplateField, you're on your own ;-) To create the code I posted, close the Edit Columns dialog and switch the page from Design View into Markup View. Then you can manually modify the contents of the TemplateField. Additionally, you can modify its content using the Design View by choosing Edit Templates on the GridView's smart tasks panel.

I talk about this and a lot more in detail in my book Beginning ASP.NET 3.5: There's also an updated versio for ASP.NET available.


Imar Spaanjaars
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!