Hi All,
Under what circumstances would InitializingInsertionRow not fire? My scenario is outlined below:
Here's the grid:
<DataGrid:DataGridControl DockPanel.Dock="Bottom" x:Name="FundProductCalculationTypeGrid"
AutoCreateDetailConfigurations="False"
NavigationBehavior="RowOrCell"
ItemsSource="{Binding Path=FrameworkSelections}"
ReadOnly="False"
ItemScrollingBehavior="Immediate" d:LayoutOverrides="GridBox" Margin="8,57,19,131" Grid.Column="1"
InitializingInsertionRow="FundProductCalculationTypeGrid_OnInitializingInsertionRow" >
<DataGrid:DataGridControl.View>
<Views:TableView>
<Views:TableView.Theme>
<Views:AeroNormalColorTheme/>
</Views:TableView.Theme>
</Views:TableView>
</DataGrid:DataGridControl.View>
</DataGrid:DataGridControl>
<Button x:Name="AddButton" Click="AddButton_OnClick" RenderTransformOrigin="-1.535,-0.085" HorizontalAlignment="Left" VerticalAlignment="Bottom" Content="Add" Grid.Column="1" Margin="8,0,0,96.723" d:LayoutOverrides="Height" Width="60.083"/>
The datasource "FrameworkSelections" is a BindingList<T>
Here's: AddButton_OnClick
private void AddButton_OnClick(object sender, RoutedEventArgs e)
{
IBindingList bindingList = FundProductCalculationTypeGrid.ItemsSource as IBindingList;
if (bindingList != null)
{
object newItem = bindingList.AddNew();
FundProductCalculationTypeGrid.BeginEdit(newItem);
}
}
Here's FundProductCalculationTypeGrid_OnInitializingInsertionRow which never gets invoked:
private void FundProductCalculationTypeGrid_OnInitializingInsertionRow(object sender, InitializingInsertionRowEventArgs e)
{
e.InsertionRow = new ProductFundFrameworkEntryInsertionRow(); //NEVER GETS INVOKED
}
Is it something to do with the way I'm adding adding items to the underlying list? If so, how should I go about it?
I've tried assigning the event handler in both code and Xaml and neither has any effect.
Any help would be appreciated.