PowerTools SPREAD for ASP.NET 8.0J
SelectMethod プロパティ (SheetView)

データを読み取るために呼び出すメソッドの名前を取得または設定します。
構文
'Declaration
 
Public Property SelectMethod As String
public string SelectMethod {get; set;}
次のサンプルコードは、SelectMethodプロパティを使用してデータをロードします。
Add this to the FarPoint:SheetView section in the ASPX page:
<FarPoint:SheetView SheetName="Sheet1" SelectMethod="GetProducts"  AllowDelete="true" AllowInsert="true">
</FarPoint:SheetView>

//cs code
public class Product
{
    public string Name { get; set; }
    public string Desc { get; set; }

    public Product(string name, string desc)
    {
        this.Name = name;
        this.Desc = desc;
    }
}

public List<Product> GetProducts()
{
    List<Product> ls = new List<Product>();
    ls.Add(new Product("Pro1", "ProDesc1"));
    ls.Add(new Product("Pro2", "ProDesc2"));
    ls.Add(new Product("Pro3", "ProDesc3"));
    return ls;
}
Add this to the FarPoint:SheetView section in the ASPX page:
<FarPoint:SheetView SheetName="Sheet1" SelectMethod="GetProducts" AllowDelete="true" AllowInsert="true">
</FarPoint:SheetView>

'vb code
Public Class Product
    Public Property Name() As String
        Get
            Return m_Name
        End Get
        Set(value As String)
            m_Name = Value
        End Set
    End Property
    Private m_Name As String
    Public Property Desc() As String
        Get
            Return m_Desc
        End Get
        Set(value As String)
            m_Desc = Value
        End Set
    End Property
    Private m_Desc As String

    Public Sub New(name As String, desc As String)
        Me.Name = name
        Me.Desc = desc
    End Sub
End Class

Public Function GetProducts() As List(Of Product)
    Dim ls As New List(Of Product)()
    ls.Add(New Product("Pro1", "ProDesc1"))
    ls.Add(New Product("Pro2", "ProDesc2"))
    ls.Add(New Product("Pro3", "ProDesc3"))
    Return ls
End Function
参照

SheetView クラス
SheetView メンバ

 

 


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