PowerTools SPREAD for Windows Forms 8.0J
DataMember プロパティ (FpSpread)


このコンポーネントのアクティブシートに読み込むデータメンバの名前を取得または設定します。
構文
'Declaration
 
Public Property DataMember As String
'使用法
 
Dim instance As FpSpread
Dim value As String
 
instance.DataMember = value
 
value = instance.DataMember
public string DataMember {get; set;}

プロパティ値

データ メンバの名前を含む String
例外
例外説明
System.InvalidOperationExceptionシート数がゼロです。データメンバを設定するためには少なくとも1つのシートが存在する必要があります。
次のサンプルコードは、アクティブシートに読み込むデータメンバの名前を指定します。
FarPoint.Win.Spread.FpSpread fpSpread1 = new FarPoint.Win.Spread.FpSpread();
FarPoint.Win.Spread.SheetView shv = new FarPoint.Win.Spread.SheetView();
fpSpread1.Location = new Point(10, 10);
fpSpread1.Height = 200;
fpSpread1.Width = 400;
Controls.Add(fpSpread1);
fpSpread1.Sheets.Add(shv);
DataSet ds = new DataSet();
DataTable emp = new DataTable("Employees");
DataTable div = new DataTable("Division");
emp.Columns.Add("LastName");
emp.Columns.Add("FirstName");
emp.Rows.Add(new Object[] {"Jones", "Marianne"});
emp.Rows.Add(new Object[] {"Fieldes", "Anna"});
div.Columns.Add("Section");
div.Columns.Add("Specialty");
div.Rows.Add(new Object[] {"Finance", "Taxes"});
div.Rows.Add(new Object[] {"Mergers", "Legal"});
ds.Tables.AddRange(new DataTable[] {emp, div});
fpSpread1.DataSource = ds;
fpSpread1.DataMember = "Division";
Dim fpSpread1 As New FarPoint.Win.Spread.FpSpread()
Dim shv As New FarPoint.Win.Spread.SheetView()
Dim info As New FarPoint.Win.Spread.StyleInfo()
info.BackColor = Color.LightBlue
fpSpread1.Location = New Point(10, 10)
fpSpread1.Height = 200
fpSpread1.Width = 400
Controls.Add(fpSpread1)
fpSpread1.Sheets.Add(shv)
Dim ds As New DataSet()
Dim emp As New DataTable("Employees")
Dim div As New DataTable("Division")
emp.Columns.Add("LastName")
emp.Columns.Add("FirstName")
emp.Rows.Add(New Object() {"Jones", "Marianne"})
emp.Rows.Add(New Object() {"Fieldes", "Anna"})
div.Columns.Add("Section")
div.Columns.Add("Specialty")
div.Rows.Add(New Object() {"Finance", "Taxes"})
div.Rows.Add(New Object() {"Mergers", "Legal"})
ds.Tables.AddRange(New DataTable() {emp, div})
fpSpread1.DataSource = ds
fpSpread1.DataMember = "Division"
参照

FpSpread クラス
FpSpread メンバ

 

 


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