No NewItem Row

Apr 21, 2009 at 6:53 PM
I'm binding to an Observablecollection that is populated after loading the window containing the DG.  I have CanUserAddRows set to true in XAML. 
Problem:  No new row shown. Just my list of items. 

Do I have to add some sort of command to allow the user to create a new row in the collection programmatically and then set focus on the new row?  I can't tell what the expected behaviour is because I can't find any documentation explaining how to template the NewItem template.  I have read Vincent Sibal's blog at:

But with all due respect to Vincent didn't care much for it as it pretty much fails to explain how to template the new item (and the example is way too convoluted to suss the point).  Sorry if I'm coming off as negative but have spent hours trying to sort this out - to no avail.

Apr 21, 2009 at 7:53 PM
public void Do()

Figured out my problem.  I had to implement the IEditableObject on my underlying business object (which was stored in an Observablecollection). 
Seems the DG won't present a new item row if this interface isn't implemented (on a CLR object).  

Frustrating .... but on to new frustrations.  thx


May 25, 2009 at 9:43 AM


I also face the problem when I set CanUserAddRows to true, and there's no new Item to show.

But I really see the new Row months ago when I'm beginning with DataGrid and I don't implement the IEditableObject, just using default settings and bind to my Observablecollection. At that time I set CanUserAddRows to false to avoid the New Row.

Now I need to get the new Row back, so I set CanUserAddRows to true, but it doesn't work. It really confused me.

I don't know do I must implement IEditableObject, because I don't want to change too much to my current code.

Thanks very much

May 26, 2009 at 1:43 PM

First check if IEditableCollectionView.CanAddNew is returning false.  You can read more about it here,