Suggest a new product idea for Infragistics WPF

XamDataGrid - AllowAddNew - Do not require a public parameter less constructor

When the datasource is a generic list without a public parameterless constructor, support adding new via IEditableCollectionView AddNew

0 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)

    We’ll send you updates on this idea

    Anonymous shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Brian LagunasAdminBrian Lagunas (Admin, Infragistics) commented  ·   ·  Flag as inappropriate

        If you are creating a custom collection that implements IEditableCollectionView, then you don't have to have a parameterless ctor because you will be implementing the logic to add your objects to the collection. If you are using a default implementation of IEditableCollectionView, such as the ListCollectionView, then you will only be able to automatically add items to the collection if the collection is able to create an instance of the object, meaning it has to have a parameterless ctor.

        So you have a couple of options:

        - Create a custom collection that implements IEditableCollectionView
        - Using a BindingList and use the xamDataGrid.AddingNew event.
        - Add a parameterless ctor and initialize your object's properties to default values.

      Feedback and Knowledge Base