FarPoint.Win.SpreadJ アセンブリ > FarPoint.Win.Spread 名前空間 > FpSpread クラス : DataMember プロパティ |
'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;}
例外 | 説明 |
---|---|
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"