When deriving a cell type based on this type, override this to change what gets passed back and formatted as a string into the cell on the sheet from the object in the data model.
Overload List
Overload | Description |
Format | When deriving a cell type based on this type, override this to change what gets passed back and formatted as a string into the cell on the sheet from the object in the data model. |
Example
The following example subclasses the CurrencyCellType class and creates a currency cell in the first cell of the spreadsheet.
C# | Copy Code |
---|
[Serializable()]
classmyCombo:FarPoint.Web.Spread.ComboBoxCellType
{
publicoverridestringFormat(objecto)
{
returnbase.Format(o);
}
publicoverrideBaseValidatorGetValidator()
{
returnbase.GetValidator();
}
publicoverrideControlPaintCell(stringid,TableCelltc,FarPoint.Web.Spread.Appearancestyle,FarPoint.Web.Spread.Insetmargin,objectv,boolul)
{
returnbase.PaintCell(id,tc,style,margin,v,ul);
}
publicoverrideobjectParse(strings)
{
returnbase.Parse(s);
}
publicoverrideboolValidateEditorValue(objectval,outstringreason)
{
returnbase.ValidateEditorValue(val,outreason);
}
}
privatevoidPage_Load(objectsender,System.EventArgse)
{
myCurrcurr=newmyCurr();
FpSpread1.ActiveSheetView.Cells[0,0].CellType=curr;
FpSpread1.ActiveSheetView.SetCellValue(0,0,99.95);
} |
Visual Basic | Copy Code |
---|
<Serializable()>
PublicClassmyCurr
InheritsFarPoint.Web.Spread.CurrencyCellType
PublicOverridesFunctionFormat(ByValoAsObject)AsString
ReturnMyBase.Format(o)
EndFunction
PublicOverridesFunctionGetValidator()AsBaseValidator
ReturnMyBase.GetValidator
EndFunction
PublicOverridesFunctionPaintCell(ByValidAsString,ByValtcAsTableCell,ByValstyleAsFarPoint.Web.Spread.Appearance,ByValmarginAsFarPoint.Web.Spread.Inset,ByValvAsObject,ByValulAsBoolean)AsSystem.Web.UI.Control
ReturnMyBase.PaintCell(id,tc,style,margin,v,ul)
EndFunction
PublicOverridesFunctionParse(ByValsAsString)AsObject
ReturnMyBase.Parse(s)
EndFunction
PublicOverridesFunctionValidateEditorValue(ByValvalAsObject,ByRefreasonAsString)AsBoolean
ReturnMyBase.ValidateEditorValue(val,reason)
EndFunction
EndClass
PrivateSubPage_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load
DimcurrAsNewmyCurr()
FpSpread1.ActiveSheetView.Cells(0,0).CellType=curr
FpSpread1.ActiveSheetView.SetCellValue(0,0,99.95)
EndSub |
Requirements
Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6
See Also