FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > CheckBoxCellType Class : Format Method |
'Usage Dim instance As CheckBoxCellType Dim o As Object Dim value As String value = instance.Format(o)
[Serializable()] class myCheck:FarPoint.Web.Spread.CheckBoxCellType { public myCheck(string img1,string img2) { Base.CheckedImageUrl=img1; Base.UncheckedImageUrl=img2; } public override string Format(object o) { return Base.Format(o); } public override Control GetEditorControl(string id,TableCell tc,FarPoint.Web.Spread.Appearance style,FarPoint.Web.Spread.Inset margin,object v,bool ul) { return Base.GetEditorControl(id,tc,style,margin,v,ul); } public override object GetEditorValue(Control owner,string id) { return Base.GetEditorValue(owner,id); } public override Control PaintCell(string id,TableCell tc,FarPoint.Web.Spread.Appearance style,FarPoint.Web.Spread.Inset margin,object v,bool ul) { return Base.PaintCell(id,tc,style,margin,v,ul); } public override object Parse(string s) { return Base.Parse(s); } public override bool ValidateEditorValue(object val,out string reason) { return Base.ValidateEditorValue(val,out reason); } new public bool BooleanValue { Get { return Base.BooleanValue; } Set { Base.BooleanValue=value; } } public override string EditorClientScriptUrl{Get{Return"checkboxeditor.htc";}} public override string RendererClientScriptUrl{Get{Return"checkboxrender.htc";}} } private void Page_Load(object sender,System.EventArgs e) { myCheckckbox= new myCheck("img/checked.gif","img/unchecked.gif"); ckbox.BooleanValue=False; FpSpread1.ActiveSheetView.Cells[0,0].CellType=ckbox; FpSpread1.ActiveSheetView.SetValue(0,0,1); }
<Serializable()> Public Class myCheck Inherits FarPoint.Web.Spread.CheckBoxCellType Sub New(ByVal img1 As String,ByVal img2 As String) MyBase.CheckedImageUrl=img1 MyBase.UncheckedImageUrl=img2 End Sub Public Overrides Function Format(ByVal o As Object)As String Return MyBase.Format(o) End Function Public Overrides Function GetEditorControl(ByVal id As String,ByVal tc As TableCell,ByVal style As FarPoint.Web.Spread.Appearance,ByVal margin As FarPoint.Web.Spread.Inset,ByVal v As Object,ByVal ul As Boolean)As System.Web.UI.Control Return MyBase.GetEditorControl(id,tc,style,margin,v,ul) End Function Public Overrides Function GetEditorValue(ByVal owner As Control,ByVal id As String)As Object Return MyBase.GetEditorValue(owner,id) End Function Public Overrides Function PaintCell(ByVal id As String,ByVal tc As TableCell,ByVal style As FarPoint.Web.Spread.Appearance,ByVal margin As FarPoint.Web.Spread.Inset,ByVal v As Object,ByVal ul As Boolean)As System.Web.UI.Control Return MyBase.PaintCell(id,tc,style,margin,v,ul) End Function Public Overrides Function Parse(ByVal s As String)As Object Return MyBase.Parse(s) End Function Public Overrides Function ValidateEditorValue(ByVal val As Object,ByRef reason As String)As Boolean Return MyBase.ValidateEditorValue(val,reason) End Function Public ShadowsPropertyBooleanValue()As Boolean Get Return MyBase.BooleanValue End Get Set(ByVal ValueAsBoolean) MyBase.BooleanValue=Value End Set End Property Public ShadowsPropertyCheckedImageUrl()As String Get Return MyBase.CheckedImageUrl End Get Set(ByVal Value As String) MyBase.CheckedImageUrl=Value End Set End Property Public Overrides ReadOnly PropertyEditorClientScriptUrl()As String Get Return"checkboxeditor.htc" End Get End Property Public Overrides ReadOnly PropertyRendererClientScriptUrl()As String Get Return"checkboxrender.htc" End Get End Property Public ShadowsPropertyUncheckedImageUrl()As String Get Return MyBase.UncheckedImageUrl End Get Set(ByVal Value As String) MyBase.UncheckedImageUrl=Value End Set End Property End Class Private SubPage_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load Dim ckbox As New myCheck("img\checked.gif","img\unchecked.gif") ckbox.BooleanValue=False FpSpread1.ActiveSheetView.Cells(0,0).CellType=ckbox FpSpread1.ActiveSheetView.SetValue(0,0,1) EndSub
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