DataGrid with an empty list can only create one item.

Sep 22, 2010 at 12:14 PM

Hi All,

I'd appreciate a pointer in the direction of some documentation to deal with CRUD operations like this against a list of objects.

I've set the itemssource of my datagrid to an observablecollection of objects. If there is at least one object already in this list, the datagrid will let me add new ones to the bottom, creating a new row as a tab off the end of the last one (aside: perversly setting the selection not to the next new row, but back at the top of the grid!!).

However, if my list is empty (that is, not null, but has zero items in it) then the grid appears with one row. Now when I tab off the end of the row, the grid does not create a new row! Why not? Is this something I need to handle?