GrapeCity.Xaml.SpreadSheet.Data
Formatter Property (Cell)
Example 


Gets or sets the formatter for a cell.
Syntax
'Declaration
 
<DefaultValueAttribute()>
Public Property Formatter As IFormatter
'Usage
 
Dim instance As Cell
Dim value As IFormatter
 
instance.Formatter = value
 
value = instance.Formatter
[DefaultValue()]
public IFormatter Formatter {get; set;}

Property Value

An IFormatter object that specifies the formatter for the cell. The default value is null.
Example
This example sets the Formatter property.
double dvalue = 12345.6789;       
gcSpreadSheet1.Sheets[0].Cells[0, 0].Formatter = new GrapeCity.Xaml.SpreadSheet.Data.GeneralFormatter(GrapeCity.Xaml.SpreadSheet.Data.FormatMode.StandardNumericMode, "c");
gcSpreadSheet1.Sheets[0].Cells[0, 0].Value = dvalue;
gcSpreadSheet1.Sheets[0].Cells[0, 1].Formatter = new GrapeCity.Xaml.SpreadSheet.Data.GeneralFormatter(GrapeCity.Xaml.SpreadSheet.Data.FormatMode.StandardDateTimeMode, "M");
gcSpreadSheet1.Sheets[0].SetValue(0, 1, new DateTime(2011, 2, 9));
gcSpreadSheet1.Sheets[0].Cells[0, 2].Formatter = new GrapeCity.Xaml.SpreadSheet.Data.GeneralFormatter("m");
gcSpreadSheet1.Sheets[0].SetValue(0, 2, new DateTime(2012, 10, 15));
gcSpreadSheet1.Sheets[0].Cells[0, 3].Formatter = new GrapeCity.Xaml.SpreadSheet.Data.GeneralFormatter();
gcSpreadSheet1.Sheets[0].SetValue(0, 3, new DateTime(2012, 10, 15));
gcSpreadSheet1.Sheets[0].Cells[0, 4].Formatter = new GrapeCity.Xaml.SpreadSheet.Data.GeneralFormatter(GrapeCity.Xaml.SpreadSheet.Data.FormatMode.CustomMode, "#.#%");
gcSpreadSheet1.Sheets[0].SetValue(0, 4, 1);
gcSpreadSheet1.Sheets[0].Cells[1, 0].Formatter = new GrapeCity.Xaml.SpreadSheet.Data.GeneralFormatter(GrapeCity.Xaml.SpreadSheet.Data.FormatMode.CustomMode, "[>2]0.0;[<-3]0.0;zero;");
gcSpreadSheet1.Sheets[0].SetValue(1, 0, 3);
Dim dvalue As Double
dvalue = 12345.6789
GcSpreadSheet1.Sheets(0).Cells(0, 0).Formatter = New GrapeCity.Xaml.SpreadSheet.Data.GeneralFormatter(GrapeCity.Xaml.SpreadSheet.Data.FormatMode.StandardNumericMode, "c")
GcSpreadSheet1.Sheets(0).Cells(0, 0).Value = dvalue
GcSpreadSheet1.Sheets(0).Cells(0, 1).Formatter = New GrapeCity.Xaml.SpreadSheet.Data.GeneralFormatter(GrapeCity.Xaml.SpreadSheet.Data.FormatMode.StandardDateTimeMode, "M")
GcSpreadSheet1.Sheets(0).SetValue(0, 1, New DateTime(2011, 2, 9))
GcSpreadSheet1.Sheets(0).Cells(0, 2).Formatter = New GrapeCity.Xaml.SpreadSheet.Data.GeneralFormatter("m")
GcSpreadSheet1.Sheets(0).SetValue(0, 2, New DateTime(2012, 10, 15))
GcSpreadSheet1.Sheets(0).Cells(0, 3).Formatter = New GrapeCity.Xaml.SpreadSheet.Data.GeneralFormatter()
GcSpreadSheet1.Sheets(0).SetValue(0, 3, New DateTime(2012, 10, 15))
GcSpreadSheet1.Sheets(0).Cells(0, 4).Formatter = New GrapeCity.Xaml.SpreadSheet.Data.GeneralFormatter(GrapeCity.Xaml.SpreadSheet.Data.FormatMode.CustomMode, "#.#%")
GcSpreadSheet1.Sheets(0).SetValue(0, 4, 1)
GcSpreadSheet1.Sheets(0).Cells(1, 0).Formatter = New GrapeCity.Xaml.SpreadSheet.Data.GeneralFormatter(GrapeCity.Xaml.SpreadSheet.Data.FormatMode.CustomMode, "[>2]0.0;[<-3]0.0;zero;")
GcSpreadSheet1.Sheets(0).SetValue(1, 0, 3)
Requirements

Target Platforms: Windows Server 2012, Windows RT

See Also

Reference

Cell Class
Cell Members

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options