Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1035
Row insertion not supported by this data source
posted

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

Parents
No Data
Reply
  • 69832
    Offline posted

    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.

Children