I\'m using the WPF DataGrid
(.Net 3.5 SP 1 version from the Toolkit)
What event can I subscribe to, to detect when a new row is added?
In you XAML, include the following code in your Window tag:
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:cmd="http://www.galasoft.ch/mvvmlight"
Next, inside you DataGrid element, add the following trigger:
Next, in you View Model, add a command for handling the event :
public RelayCommand LoadRowHandler{ get; private set; }
Inside constructor, initialize the command:
LoadRowHandler = new RelayCommand(LoadingRowHandlerMethod);
Next, create a method where you want to put the logic:
private void LoadingRowHandlerMethod(DataGridRowEventArgs e)
{
//....
//....
}
That's all. Now whenever a new row is added to your DataGrid, the LoadingRowHandlerMethod will get executed.
Hope it helps.