Spread for ASP.NET 8.0 Product Documentation
GetEditorControl Method (ButtonCellType)
Example 


Unique identifier of the control
Parent cell (TableCell object) of the control
Style settings (Appearance object) for the control
Margin settings (Inset object) for the control
Value (as object) to put in the control
Whether the control can render in an up-level browser
Gets the control used to edit the cell (and this implementation always returns null).
Syntax
'Declaration
 
Public Overrides Function GetEditorControl( _
   ByVal id As String, _
   ByVal parent As TableCell, _
   ByVal style As Appearance, _
   ByVal margin As Inset, _
   ByVal value As Object, _
   ByVal upperLevel As Boolean _
) As Control
'Usage
 
Dim instance As ButtonCellType
Dim id As String
Dim parent As TableCell
Dim style As Appearance
Dim margin As Inset
Dim value As Object
Dim upperLevel As Boolean
Dim value As Control
 
value = instance.GetEditorControl(id, parent, style, margin, value, upperLevel)
public override Control GetEditorControl( 
   string id,
   TableCell parent,
   Appearance style,
   Inset margin,
   object value,
   bool upperLevel
)

Parameters

id
Unique identifier of the control
parent
Parent cell (TableCell object) of the control
style
Style settings (Appearance object) for the control
margin
Margin settings (Inset object) for the control
value
Value (as object) to put in the control
upperLevel
Whether the control can render in an up-level browser

Return Value

Control object containing the editor control to edit the cell
Remarks

The Spread component always positions the editor control returned by the GetEditorControl method so that the editor control covers the entire cell.

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 Sub Page_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
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

Reference

ButtonCellType Class
ButtonCellType Members

 

 


Copyright © GrapeCity, inc. All rights reserved.