<FarPoint:FpSpread ID="FpSpread1" ItemType="spweb7vb2012.WebForm1+Product" runat="server" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" Height="200" Width="400">
<commandbar backcolor="Control" buttonfacecolor="Control" buttonhighlightcolor="ControlLightLight" buttonshadowcolor="ControlDark">
</commandbar>
<sheets>
<FarPoint:SheetView SheetName="Sheet1" AllowDelete="true" AllowInsert="true" SelectMethod="GetProducts" DeleteMethod="DeleteUser" InsertMethod="InsertUser" UpdateMethod="UpdateUser">
</FarPoint:SheetView>
</sheets>
</FarPoint:FpSpread>
//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 IQueryable<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.AsQueryable();
}
<FarPoint:FpSpread ID="FpSpread1" ItemType="spweb7vb2012.WebForm1+Product" runat="server" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" Height="200" Width="400">
<commandbar backcolor="Control" buttonfacecolor="Control" buttonhighlightcolor="ControlLightLight" buttonshadowcolor="ControlDark">
</commandbar>
<sheets>
<FarPoint:SheetView SheetName="Sheet1" AllowDelete="true" AllowInsert="true" SelectMethod="GetProducts" DeleteMethod="DeleteUser" InsertMethod="InsertUser" UpdateMethod="UpdateUser">
</FarPoint:SheetView>
</sheets>
</FarPoint:FpSpread>
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 IQueryable(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.AsQueryable()
End Function