Welcome to ASP.NET Guild

Be sure to come back often and tell others. If you have any tips, tricks, examples, please email them to me at chris.williams@techguilds.com and I will post them. Check out our ASP.NET QuickStart and C# QuckStart Libraries. Below is my latest articles.

Monday, February 06, 2006

GridView Tips and Tricks

This article will contain a list of tips and tricks related to the using the GridView.










Formatting data using DataFormatString

EXAMPLE:


I was having an issue with it not applying my format. If it doesn’t work its one of the 3 key reasons below.For me I did not have HtmlEncode set to false.

The key properties are as follows:

o HtmlEncode = "False" ensures that the formatting is applied when displaying the date field. Without it, the formatting doesn't apply for some unknown reason.

o ApplyFormatInEditMode = "True" ensures that the DataFormatString is also applied when you change to the Edit mode. Without it, the formatting is ignored in Edit mode.

No comments:

Are you a .NET Developer or Contractor interested in working with Sitecore or Dynamics CRM?

Apply for our Mentorship Program. If accepted, we will mentor you on Sitecore and provide you with project to help you build your skills and make some money at the same time. If you are interested send your resume with details on why you want to work with Sitecore or Dynamics CRM to: Chris Williams - chris.williams@techguilds.com or Dennis Augustine - dennis.augustine@techguilds.com We look forward to working with you to achieve your goals.