I bind ObservableCollection to ListView and I get {NewItemPlaceholder} line at the end. How can I hide or remove that line?
Like alot of people, I had the same issues but after some thinking, it occured to me that I could just create a bool property in the ViewModel and bind it to the DataGrid CanUserAddRows Property like below. Then I can make the property true or false as needed:
private bool _canUserAddRows;
public bool CanUserAddRows
{
get { return _canUserAddRows; }
set
{
_canUserAddRows = value;
NotifyPropertyChanged("CanUserAddRows");
}
}
<--!--DataGrid property --!-->
CanUserAddRows="{Binding CanUserAddRows,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
This is easier and works very well. Hope it helps you.