What is the best event to detect when a new row has been added via binding?
For instance I have a WPF (form application) with a grid bound to a ObservableCollection<foo> class. When I add a new object to the collection, it is added to grid automatically.
I want to detect that a new row has been added by the grid and put the select a cell and put it in edit mode.
I'm currently accomplishing this task using the RowLoaded event and it is working. However, once there are enough rows added that cause the grid to have a vertical scroll bar AND the user then scrolls up in the grid then the RowLoaded event fires again ... even though the row already exists. So I've had to had special code to really identify in RowLoaded when the event fired from a true add to the collection.
I would like to know if there is another event to use and I've inspected several of them. I thought DataLoaded would work and it fires, however I cannot figure out a way to make a particular cell selected and placed in mode via this event. The code that I'm using that is working in RowLoaded event is this
Thanks ... Chad
For instance I have a WPF (form application) with a grid bound to a ObservableCollection<foo> class. When I add a new object to the collection, it is added to grid automatically.
I want to detect that a new row has been added by the grid and put the select a cell and put it in edit mode.
I'm currently accomplishing this task using the RowLoaded event and it is working. However, once there are enough rows added that cause the grid to have a vertical scroll bar AND the user then scrolls up in the grid then the RowLoaded event fires again ... even though the row already exists. So I've had to had special code to really identify in RowLoaded when the event fired from a true add to the collection.
I would like to know if there is another event to use and I've inspected several of them. I thought DataLoaded would work and it fires, however I cannot figure out a way to make a particular cell selected and placed in mode via this event. The code that I'm using that is working in RowLoaded event is this
if (e.DataElement != null)
{
((GridViewCell)e.Row.Cells[7]).BeginEdit();
}
Thanks ... Chad