Spread for ASP.NET 11 Product Documentation
PaintCell Method (ButtonCellType)
Example 


FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > ButtonCellType Class : PaintCell Method
Gets a control and renders it in the cell based on the specified appearance, margin, and value.
Overload List
OverloadDescription
Gets a control and renders it in the cell based on the specified appearance, margin, and value.  
Gets a control and prints the cell to PDF based on the specified appearance and selection.  
Example
This example subclasses the ButtonCellType and creates a button cell in the first cell of the spreadsheet.
[Serializable()]
class btnType:FarPoint.Web.Spread.ButtonCellType
{
public override ControlGetEditorControl(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 ControlPaintCell(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)
{
btnType mybtn=new btnType();
FpSpread1.ActiveSheetView.Cells[0,0].CellType=mybtn;
}
<Serializable()>
Public Class btnType
Inherits FarPoint.Web.Spread.ButtonCellType

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

Private SubPage_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load
Dim mybtn As New btnType()
FpSpread1.ActiveSheetView.Cells(0,0).CellType=mybtn
End Sub
See Also

Reference

ButtonCellType Class
ButtonCellType Members