Visual Basic (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 |
Visual Basic (Usage) | Copy Code |
---|---|
Dim instance As GeneralCellType 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) |
C# | |
---|---|
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) for 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 cellThe Spread component always positions the editor control returned by the GetEditorControl method so that the editor control covers the entire cell.
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