PowerTools SPREAD for ASP.NET 8.0J
IsColumnBound メソッド (DefaultSheetDataModel)

チェックする列インデックス
指定の列がデータソース列に連結されているかどうかを判別します。
構文
'Declaration
 
Public Function IsColumnBound( _
   ByVal column As Integer _
) As Boolean
public bool IsColumnBound( 
   int column
)

パラメータ

column
チェックする列インデックス

戻り値の型

列が連結されている場合はtrue、それ以外の場合はfalse
この例では、DefaultSheetDataModelをDataTableに連結し、IsColumnBound、IsEditable、IsEmpty、IsRowUsedの各値をリストボックスに返します。
 Private void Page_Load(object sender, System.EventArgs e)
{
    If (this.IsPostBack) Return;

    bool b, b1, b2, b3;
    DataTable dt = New DataTable("GrapeCity");
    dt.Columns.Add("Product");
    dt.Rows.Add(New Object[] {"SPREAD for ASP.NET"});
    dt.Rows.Add(New Object[] {"InputMan for Windows Forms"});
    DataRow nrow;
    nrow = dt.NewRow();
    nrow["Product"] = "To Be Announced";
    dt.Rows.Add(nrow);
    dt.AcceptChanges();
    FarPoint.Web.Spread.Model.DefaultSheetDataModel dm = New FarPoint.Web.Spread.Model.DefaultSheetDataModel(dt);
    FpSpread1.ActiveSheetView.DataModel = dm;
    FpSpread1.ActiveSheetView.Columns[0].Width = 240;
    b = dm.IsColumnBound(0);
    b1 = dm.IsEditable(0,0);
    b2 = dm.IsEmpty();
    b3 = dm.IsRowUsed(1);
    ListBox1.Items.Add(b.ToString());
    ListBox1.Items.Add(b1.ToString());
    ListBox1.Items.Add(b2.ToString());
    ListBox1.Items.Add(b3.ToString());
}
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    If Me.IsPostBack Then Return

    Dim b, b1, b2, b3 As Boolean
    Dim dt As New DataTable("GrapeCity")
    dt.Columns.Add("Product")
    dt.Rows.Add(New Object() {"SPREAD for ASP.NET"})
    dt.Rows.Add(New Object() {"InputMan for Windows Forms"})
    Dim nrow As DataRow
    nrow = dt.NewRow()
    nrow("Product") = "To Be Announced"
    dt.Rows.Add(nrow)
    dt.AcceptChanges()
    Dim dm As FarPoint.Web.Spread.Model.DefaultSheetDataModel = New FarPoint.Web.Spread.Model.DefaultSheetDataModel(dt)
    FpSpread1.ActiveSheetView.DataModel = dm
    FpSpread1.ActiveSheetView.Columns(0).Width = 240
    b = dm.IsColumnBounded(0)
    b1 = dm.IsEditable(0, 0)
    b2 = dm.IsEmpty()
    b3 = dm.IsRowUsed(1)
    ListBox1.Items.Add(b.ToString())
    ListBox1.Items.Add(b1.ToString())
    ListBox1.Items.Add(b2.ToString())
    ListBox1.Items.Add(b3.ToString())

End Sub
参照

DefaultSheetDataModel クラス
DefaultSheetDataModel メンバ

 

 


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