Spread for ASP.NET 7.0 Product Documentation
PaintCell Method
See Also  Example Support Options
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()>Public Class generic
InheritsFarPoint.Web.Spread.GeneralCellType

Public Overrides Function GetEditorControl(ByVal id As String,ByVal parent As TableCell,ByVal style As FarPoint.Web.Spread.Appearance,ByVal margin As FarPoint.Web.Spread.Inset,ByVal val As Object,ByVal ul As Boolean)As System.Web.UI.Control
Return MyBase.GetEditorControl(id,parent,style,margin,val,ul)
End Function

Public Overrides Function PaintCell(ByVal id As String, ByVal parent As TableCell, ByVal style As FarPoint.Web.Spread.Appearance,ByVal margin As FarPoint.Web.Spread.Inset,ByVal val As Object,ByVal ul As Boolean)As System.Web.UI.Control
Return MyBase.PaintCell(id,parent,style,margin,val,ul)
End Function

End Class

PrivateSubPage_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)HandlesMyBase.Load
Dim gencell As New generic()
FpSpread1.ActiveSheetView.Cells(0,0).CellType=gencell
FpSpread1.ActiveSheetView.SetValue(0,0,"Thisisatesttoseeifthetextwrapsinthecell")
FpSpread1.ActiveSheetView.Rows(0).Height=180
End Sub
C#Copy Code
[Serializable()]
class gentype:FarPoint.Web.Spread.GeneralCellType
{
public override Control GetEditorControl(string id,TableCell parent,FarPoint.Web.Spread.Appearance style,FarPoint.Web.Spread.Inset margin,object v,bool ul)
{
return base.GetEditorControl(id,parent,style,margin,v,ul);
}
public override Control PaintCell(string id,TableCell parent,FarPoint.Web.Spread.Appearance style,FarPoint.Web.Spread.Inset margin,object v,bool ul)
{
return base.PaintCell(id,parent,style,margin,v,ul);
}
}

private void Page_Load(object sender, System.EventArgs e)
{
gentypegencell=newgentype();
FpSpread1.ActiveSheetView.Cells[0,0].CellType=gencell;
FpSpread1.ActiveSheetView.SetValue(0,0,"Thisisatesttoseeifthetextwrapsinthecell");
FpSpread1.ActiveSheetView.Rows[0].Height=180;
}

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

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.