Spread for ASP.NET 11 Product Documentation
SelectMethod Property (SheetView)
Example 


FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > SheetView Class : SelectMethod Property
Gets or sets the name of the method to call in order to read data.
Syntax
'Declaration
 
Public Property SelectMethod As String
'Usage
 
Dim instance As SheetView
Dim value As String
 
instance.SelectMethod = value
 
value = instance.SelectMethod
public string SelectMethod {get; set;}
Example
This example uses the SelectMethod property to load data.
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
See Also

Reference

SheetView Class
SheetView Members