select

Grid / Column Formatting

Rate this demo: Feedback
Run example in: C# VB.NET Change Skin:
Vista
  • BlackBlack
  • DefaultDefault
  • ForestForest
  • HayHay
  • Office2007Office2007
  • OutlookOutlook
  • SimpleSimple
  • SitefinitySitefinity
  • SunsetSunset
  • TelerikTelerik
  • VistaVista
  • Web20Web20
  • WebBlueWebBlue
  • Windows7Windows7
select
select
select
select
DatesCurrencyNumberTelephone
10/10/06$2.01300%(949)250-9340
12/08/05$35.5445700%(949)365-4897
03/05/00$232.94456000%(609)234-3454
12/16/96$5,263.9567000%(609)654-8974
01/01/01$22,453.74898700%(942)345-2543
09/03/09$604,560.064325746500%(943)643-5644
09/06/06$98,457,669.9945674334500%(344)545-4446
10/10/06$2.01300%(949)250-9340
12/08/05$35.5445700%(949)365-4897
03/05/00$232.94456000%(609)234-3454
12/16/96$5,263.9567000%(609)654-8974
01/01/01$22,453.74898700%(942)345-2543
09/03/09$604,560.064325746500%(943)643-5644
09/06/06$98,457,669.9945674334500%(344)545-4446

Example Source Code & Description

Instructions
Open in new window
  • Use the DataFormatString property to specify a custom format for the values displayed in the GridBoundColumn object. If the DataFormatString property is not set, the field's value is displayed without any special formatting.

    The formatting string can be any literal string and usually includes a placeholder for the field's value. For example, in the formatting string is "Item Value: {0}", the field's value is substituted for the {0} placeholder when the string is displayed in the GridBoundColumn object. The rest of the formatting string is displayed as literal text (Item Value in this case).
    However, make sure that the columns in the grid source are of the proper type - DateTime (for dates), Integer for telephone numbers/currencies, etc.

    Further information about the data format strings can be found in the grid documentation:
    Formatting column values
Compatible with ASP.NET 2.0, 3.5 AJAX enabled Accessibility Verified!Valid XHTML 1.1! Optimized for Visual Studio 2005, 2008
Copyright 2002-2010 © Telerik. All right reserved  | 
Telerik Inc., 460 Totten Pond Rd, Suite 640, Waltham, MA 02451

www.telerik.com  |  Terms of Use  |  Contact Us