Private Sub Page_Load(ByVal sender As System.Object,ByVal e As System.EventArgs)Handles MyBase.Load
If(IsPostBack)Then Return
Dim dsAs New System.Data.DataSet()
Dim dm As New FarPoint.Web.Spread.Model.DefaultSheetDataModel()
FpSpread1.ActiveSheetView.DataModel=dm
Dim emp As DataTable=New DataTable("Employee")
Dim lname As DataColumn=New DataColumn("LastName",GetType(System.String))
Dim fname As DataColumn=New DataColumn("FirstName",GetType(System.String))
Dim id As DataColumn=emp.Columns.Add("ID",GetType(System.Int32))
id.AutoIncrement=True
Dim primarykey As DataColumn()=New DataColumn(){id}
emp.PrimaryKey=primarykey
emp.Columns.Add(lname)
emp.Columns.Add(fname)
ds.Tables.Add(emp)
Dim ti As DataRow=emp.NewRow()
ti(lname)="Bazemoreland"
ti(fname)="Ti"
emp.Rows.Add(ti)
Dim ginny As DataRow=emp.NewRow()
ginny(lname)="Danielson"
ginny(fname)="Ginny"
emp.Rows.Add(ginny)
Dim bob As DataRow=emp.NewRow()
bob(lname)="Morrison"
bob(fname)="Bob"
emp.Rows.Add(bob)
ds.AcceptChanges()
dm.DataSource=ds
dm.SetModelDataColumn(0,"FirstName")
dm.SetModelDataColumn(2,0)
End Sub