Hi,
I have an ultraGrid with 2 bands.Its dataSource is coming from a binding source:
BindingSource
bs;bs = new BindingSource();bs.DataSource = myEntity;myGrid.DataSource = bs;
In order to add a new row to a band in the grid, I'm using the AddNew() method:
myGrid.DisplayLayout.Bands[
"AAA"].AddNew();
I'm getting the following exception:
"Row insertion not supported by this data source."
Any idea why does it happen?
Thanks!Yael
The problem was that
grdMovements.DisplayLayout.Override.AllowAddNew
was set to AllowAddNew.No instead of AllowAddNew.Yes
Thanks anyway!Yael
Your 'myEntity' class does not implement the necessary interfaces (IBindingList for example). One solution is to use a BindingList<T> where T is the type of the objects in the list you want to bind.
Note that I have also seen problems like this with classes that do not publicly expose a parameterless constructor; the data binding layer uses reflection to find a parameterless constructor so it can create a new instance, and when it doesn't find one it errors out.