<Serializable()>
Public Class myeditor
Inherits FarPoint.Web.Spread.Editor.GeneralEditor
Public Overrides ReadOnly Property EditorClientScriptUrl() As String
Get
Return MyBase.EditorClientScriptUrl()
End Get
End Property
Public Overrides Function GetEditorControl(ByVal id As String, ByVal parent As System.Web.UI.WebControls.TableCell, ByVal
style As FarPoint.Web.Spread.Appearance, ByVal margin As FarPoint.Web.Spread.Inset, ByVal value As Object, ByVal upperLevel
As Boolean) As System.Web.UI.Control
Dim c As Control = MyBase.GetEditorControl(id, parent, style, margin, value, upperLevel)
Dim tb As New TextBox
tb = CType(c, TextBox)
tb.MaxLength = 5
Return tb
End Function
Public Overrides Function GetEditorValue(ByVal owner As System.Web.UI.Control, ByVal id As String) As Object
Return MyBase.GetEditorValue(owner, id)
End Function
Public Overrides Function GetValidator() As System.Web.UI.WebControls.BaseValidator
Return MyBase.GetValidator()
End Function
Public Overrides Function ValidateEditorValue(ByVal value As Object) As String
Return MyBase.ValidateEditorValue(value)
End Function
End Class
Dim s As FarPoint.Web.Spread.SheetStyleProperty
Dim si As New FarPoint.Web.Spread.StyleInfo("DataAreaDefault")
si.Editor = New myeditor
FpSpread1.ActiveSheetView.DefaultStyle = si
Dim b As Boolean
If IsPostBack Then
b = si.IsPropertySet(s.Editor)
If b Then
Response.Write("The editor has been set.")
End If
End If