I am new to WPF data grid. Here is what I am trying to do: I have a data grid which I am binding to a DataTable (using DataTable.DefaultView). In my data grid, I have an Insert Button in the header to insert a new row in the grid. Now here is what I want
1. When I add a new row, a "NewItemPlaceHolder" row is created as well. Is there a way using which I can hide this row? I did look around the forums and one recommendation with to define the ItemsSource of the grid by creating a new CollectionView
object (something like dg.ItemsSource = new CollectionView(dg.ItemsSource). This does remove the "NewItemPlaceHolder" but now my items source is no longer a DataView object.
2. When I insert a new row, I want the focus on the 1st cell of the newly created row. In Silverlight, I can simply do by putting the focus on the datagrid, call it's ScrollIntoView() method & then finding the cell content & putting the focus there.
How do I do this here?
Any help would be highly appreciated.