Spread ASP.NET 6.0 Product Documentation
PaintCell Method
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > GeneralCellType Class : PaintCell Method


Glossary Item Box

Gets a control and renders it in the cell based on the specified appearance, margin, and value.

Overload List

OverloadDescription
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.  

Example

This example subclasses the GeneralCellType class and uses it in the first cell of the spreadsheet.
Visual BasicCopy 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;
}

Requirements

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

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.