Spread ASP.NET 6.0 Product Documentation
Editor Field
See Also  Example Send Feedback
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SheetStyleProperty Class : Editor Field


Glossary Item Box

Represents the Editor property (index of 2) for the editor of the sheet style.

Syntax

Visual Basic (Declaration) 
Public Shared ReadOnly Editor As SheetStyleProperty
Visual Basic (Usage)Copy Code
Dim value As SheetStyleProperty
 
value = SheetStyleProperty.Editor
C# 
public static readonly SheetStyleProperty Editor

Example

C#Copy Code
<Serializable()> 
public class myeditor : FarPoint.Web.Spread.Editor.GeneralEditor
{
public override Control GetEditorControl(string id, TableCell parent, FarPoint.Web.Spread.Appearance style, FarPoint.Web.Spread.Inset
margin, object value, bool upperLevel) 
    { 
    TextBox mytextbox; 
    Control c; 
    c = base.GetEditorControl(id, parent, style, margin, value, upperLevel); 
    mytextbox = (TextBox) c; 
    mytextbox.MaxLength = 5; 
    return mytextbox; 
    } 
}

FarPoint.Web.Spread.StyleInfo si = new FarPoint.Web.Spread.StyleInfo("DataAreaDefault");
si.Editor = new myeditor();
FpSpread1.ActiveSheetView.DefaultStyle = si;
bool b = false;
if (IsPostBack)
{
        b = si.IsPropertySet(FarPoint.Web.Spread.SheetStyleProperty.Editor);
}
if (b)
{
        Response.Write("The editor has been set.");
}
Visual BasicCopy Code
<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

Requirements

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

See Also

© 2002-2012 GrapeCity, Inc. All Rights Reserved.