How to remove DataGrid's blank row when binding to a ObservableCollection?

The same problem persist in WPF 4.0 version of DataGrid, and it is caused by the add-new row which it shows automatically for ObservableCollection ItemsSource. Setting IsReadOnly as True it's too radical IMHO I solved it by disabling CanUserAddRows property if you don't need that behavior, but you still want cells to be modified: CanUserAddRows="False.

The same problem persist in WPF 4.0 version of DataGrid, and it is caused by the add-new row which it shows automatically for ObservableCollection ItemsSource. Setting IsReadOnly as True it's too radical IMHO. I solved it by disabling CanUserAddRows property if you don't need that behavior, but you still want cells to be modified: CanUserAddRows="False.

Agreed unless it is truly readonly then that seems over kill. – Jon Mar 23 at 12:23.

I've got it on Datagrid XAML, put the attribute: IsReadOnly="True.

Would be nice if you marked the question as answered, thanks! – Thies Aug 27 '09 at 6:48.

Count =0), but then I bind it to a DataGrid (WPFToolkit), it shows me a blank row. In immediate window, for dgEmployees. It seems to happen after I've put this Datagrid into a TabControl, but I'm not sure it has something to do with it.

Does anyone know how to remove this blank row?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions