PowerTools SPREAD for ASP.NET 8.0J
PaintCell メソッド (ComboBoxCellType)

指定した外観、マージン、および値に基づいて、コントロールを取得し、セルに描画します。
オーバーロード一覧
オーバーロード説明
PaintCell(String,TableCell,Appearance,Inset,Object,Boolean)指定した外観、マージン、および値に基づいて、コントロールを取得し、セルに描画します。  
PaintCell(PdfGraphics,RectangleF,Appearance,Object,Boolean,Boolean,Single)コントロールを取得し、指定した外観と選択範囲に基づいてセルをPDFに印刷します。  
以下の例では、ComboBoxCellTypeをサブクラス化し、スプレッドシートの先頭セルにコンボボックス型セルを作成します。コンボボックスを表示するには、先頭セルをダブルクリックします。
Imports FarPoint.Web.Spread
Partial Class SampleCode_Sample1VB
  Inherits System.Web.UI.Page

  Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load
    Dim cb As New myCombo()
    FpSpread1.ActiveSheetView.Cells(0, 0).CellType = cb
  End Sub

End Class

<Serializable()>
Public Class myCombo
  Inherits FarPoint.Web.Spread.ComboBoxCellType

  Sub New()
    MyBase.New(New String() {"One", "Two", "Three"}, New String() {"1", "2", "3"})
  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 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

End Class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FarPoint.Web.Spread;
using System.Drawing;
using System.Collections;

public partial class Sample3 : System.Web.UI.Page
{
  private void Page_Load(object sender, System.EventArgs e)
  {
    myCombo cb = new myCombo(new string[] { "One", "Two", "Three" });
    FpSpread1.ActiveSheetView.Cells[0, 0].CellType = cb;
  }
 
}

[Serializable()]
class myCombo:FarPoint.Web.Spread.ComboBoxCellType
{
  ArrayList items=new ArrayList();
  ArrayList values=new ArrayList();

public myCombo(string[]items):base(items)
{
for(int i=0;i<items.Length;i++)
{
this.items.Add(items[i]);
}
}

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 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);
}

}
参照

ComboBoxCellType クラス
ComboBoxCellType メンバ

 

 


© 2003-2015, GrapeCity inc. All rights reserved.