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
1285
No add new row
posted

I have a class that inherits ObservableCollection.  Initially the collection is empty. When I bind it to the data grid and set the allow new to true.  The add new row does not show up.

Here is some code:

  this.xamDataGridTasks.DataSource=_contract.Tasks;
            this.xamDataGridTasks.FieldLayoutSettings.AllowAddNew = true;
            this.xamDataGridTasks.FieldLayoutSettings.AddNewRecordLocation = Infragistics.Windows.DataPresenter.AddNewRecordLocation.OnTop;

  • 69686
    posted

    Hello,

    One requirement for the AddNewRecord is that the underlying class has a parameterless constructor.

    Does you class have one?

    You can also use BindingList<T> instead of ObservableCollection.

    Regards,

    Alex.