1 建立一个Store
Dim objStore As New Ext.Net.Store
Dim objModel As New Ext.Net.Model
objModel.Fields.Add("myID")
objModel.Fields.Add("myName")
objStore.Model.Add(objModel)
2 给Store 设立数据源
Dim objList As New List(Of MyClass1)
Dim objClass1 As New MyClass1
Dim objClass2 As New MyClass1
objClass1.myID = "jimmyID"
objClass1.myName = "jimmyName"
objClass2.myID = "hardenID"
objClass2.myName = "hardenName"
objList.Add(objClass1)
objList.Add(objClass2)
objStore.DataSource = objList
If (Not Ext.Net.X.IsAjaxRequest) Then
objStore.DataBind()
End If
3 将相应的store 绑定到comboBox
Dim objComboBox As New Ext.Net.ComboBox
objComboBox.Store.add(objStore)
注释: 前两步还可以设置为GridPanel的数据源,只是在第三步绑定有些许的改变而已。比如改为 objGridPanel.store.add( objStore)