Overload | Description |
---|---|
PaintCell(String,TableCell,Appearance,Inset,Object,Boolean) | Gets a control and renders it in the cell based on the specified appearance, margin, and value. |
PaintCell(PdfGraphics,RectangleF,Appearance,Object,Boolean,Boolean,Single) | Gets a control and prints the cell to PDF based on the specified appearance and selection. |
This example subclasses the GeneralCellType class and uses it in the first cell of the spreadsheet.
Visual Basic | Copy Code |
---|---|
<Serializable()>PublicClassgeneric InheritsFarPoint.Web.Spread.GeneralCellType PublicOverridesFunctionGetEditorControl(ByValidAsString,ByValparentAsTableCell,ByValstyleAsFarPoint.Web.Spread.Appearance,ByValmarginAsFarPoint.Web.Spread.Inset,ByValvalAsObject,ByValulAsBoolean)AsSystem.Web.UI.Control ReturnMyBase.GetEditorControl(id,parent,style,margin,val,ul) EndFunction PublicOverridesFunctionPaintCell(ByValidAsString,ByValparentAsTableCell,ByValstyleAsFarPoint.Web.Spread.Appearance,ByValmarginAsFarPoint.Web.Spread.Inset,ByValvalAsObject,ByValulAsBoolean)AsSystem.Web.UI.Control ReturnMyBase.PaintCell(id,parent,style,margin,val,ul) EndFunction EndClass PrivateSubPage_Load(ByValsenderAsSystem.Object,ByValeAsSystem.EventArgs)HandlesMyBase.Load DimgencellAsNewgeneric() FpSpread1.ActiveSheetView.Cells(0,0).CellType=gencell FpSpread1.ActiveSheetView.SetCellValue(0,0,"Thisisatesttoseeifthetextwrapsinthecell") FpSpread1.ActiveSheetView.Rows(0).Height=180 EndSub |
C# | Copy Code |
---|---|
[Serializable()]
classgentype:FarPoint.Web.Spread.GeneralCellType
{
publicoverrideControlGetEditorControl(stringid,TableCellparent,FarPoint.Web.Spread.Appearancestyle,FarPoint.Web.Spread.Insetmargin,objectv,boolul)
{
returnbase.GetEditorControl(id,parent,style,margin,v,ul);
}
publicoverrideControlPaintCell(stringid,TableCellparent,FarPoint.Web.Spread.Appearancestyle,FarPoint.Web.Spread.Insetmargin,objectv,boolul)
{
returnbase.PaintCell(id,parent,style,margin,v,ul);
}
}
privatevoidPage_Load(objectsender,System.EventArgse)
{
gentypegencell=newgentype();
FpSpread1.ActiveSheetView.Cells[0,0].CellType=gencell;
FpSpread1.ActiveSheetView.SetCellValue(0,0,"Thisisatesttoseeifthetextwrapsinthecell");
FpSpread1.ActiveSheetView.Rows[0].Height=180;
} |
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family