Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8199067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:05:51+00:00 2026-06-07T06:05:51+00:00

I have ObservableCollection<IInterface> which is binded to DataGrid. IInterface is interface. I want to

  • 0

I have ObservableCollection<IInterface> which is binded to DataGrid.
IInterface is interface.

I want to add new row clearly for user (without add button). I’ve added CanUserAddRows="true" but it works only when dataGrid is binded on ObservableCollection<MyClass>.

How can I programmatically create new object for new row?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T06:05:52+00:00Added an answer on June 7, 2026 at 6:05 am

    I’ve recently had the same issue. I’ve posted a solution in my blog: Enable inline adding of records for view models with non-default constructors/interfaces

    It basically involves creating a custom ListCollectionView (can be done similarly for the others) and binding the grid to that view. The custom view has a factory method used to create the rows as the default implementation in ListCollectionView doesn’t support adding rows for interfaces or classes which do not have a default constructor.

    Note that even if you do not use a CollectionView in your MVVM view model, but a regular list or an IBindingList, WPF will create a specific collection view for you. See more details WPF’s CollectionViewSource

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have observablecollection which i fill with textboxes on button click event. In my
I would like to use a WrapPanel. I have a ObservableCollection with ViewModels which
I have a set of integers: public ObservableCollection<int> Scores = new ObservableCollection<int> { 10,
I have ItemsControl which I bind to ObservableCollection On my view model I just
I have an ObservableCollection which is dataContext for my treeview when I try to
I have an ObservableCollection<Object> that contains two different types. I want to bind this
I have a ObservableCollection which holds records of custom type Item. I use that
I have a ClassA with an ObservableCollection property, that implements the INotifyPropertyChanged interface on
i have ObservableCollection with 100 records. now i want to get split that collection
I have this ListBox which is bound to an ObservableCollection. Each object in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.