Hi,
I am new to UltraGrid control. I would like to populate th grid on runtime when user select an item from a combo box, data inserts into the grid .... and when user select another item from combo box, data should append to the grid.
i believe i can not use datasource in this scenario.
i have only one band in the grid. I get this error message: "Row insertion not supported by this data source". I tried to set AddNew property to true but it set itself to False.
This is the code i have written:
Me.cmboCatPart.Items.Clear()
For Each drPartsx As DataRow In MobService.ListSubItems(lngCatIdx, False).Rows
invRow.Cells(0).Value = drPartsx.Item(1).ToString
Next
lngCatIdx = Nothing
End Sub
Thanks for your help.
Kamal
You must assign a DataTable to the Grid's DataSource Property:
Dim dataTable1 As New DataTable("dataTable1")
Me.gridInvoice1.DataSource = dataTable1
Me
.gridInvoice1.DataSource = dataTable1
markachus said:You must assign a DataTable to the Grid's DataSource Property
This is not entirely accurate.
The grid must have a data source, it will not function without one. But it does not have to be a DataTable. The grid's DataSource can accept a wide range of objects such as a DataSet, DataTable, BindingSource, UltraDataSource, etc. It will bind to any object that implements either IList or IBindingList.
If you want to use the grid without any DataBase or back end, then I recommend using the UltraDataSource component as your grid's DataSource. Or perhaps a generic BindingList<T> object.