In order to format data using mask (#) characters for an entire column or a specific cell, you must use the TextViewer and TextEditor. Simply setting the column or cell’s FormatSpecifier property will not function. You can also change the format of text displayed in a cell (or in an entire column) by creating a class that implements the IFormatProvider interface and assigning your custom class to the FormatProvider and FormatSpecifier properties of the desired cell or column.
For more information regarding the implementation of the IFormatProvider interface, go to the “Customizing Format Strings” topic of the .NET Framework’s documentation.
VB.NET
GridControl1.Columns( “Phone” ).CellEditorManager = New Xceed.Grid.Editors.TextEditor( “( ### ) ###-####” ) GridControl1.Columns( “Phone” ).CellViewerManager = New Xceed.Grid.Viewers.TextViewer( “( ### ) ###-####” )
C#
gridControl1.Columns[ “Phone” ].CellEditorManager = new Xceed.Grid.Editors.TextEditor( “( ### ) ###-####” ); gridControl1.Columns[ “Phone” ].CellViewerManager = new Xceed.Grid.Viewers.TextViewer( “( ### ) ###-####” );
|
Imported from legacy forums. Posted by Xceed admin (had 881 views)