This question is locked. New answers and comments are not allowed.
Hello,
I'm trying to add a new row to a GridView that is nested in the RowDetails of a parent GridView but when I call the AddingNewDataItem Handler it gets caught in an infinite loop. Any ideas as to why?
XAML
C#
FYI - I'm using Q3 2009.3 1208
I'm trying to add a new row to a GridView that is nested in the RowDetails of a parent GridView but when I call the AddingNewDataItem Handler it gets caught in an infinite loop. Any ideas as to why?
XAML
| <!-- Nested GridView --> |
| <telerik:RadGridView x:Name="FinishedGoodComponentsGrid" |
| ShowGroupPanel="False" |
| RowIndicatorVisibility="Collapsed" |
| ItemsSource="{Binding FinishedGoodComponents, Mode=TwoWay}" |
| AutoGenerateColumns="False" |
| IsFilteringAllowed="False" |
| RowEditEnded="GridRowEditEnded" |
| ShowInsertRow="True" |
| AddingNewDataItem="FinishedGoodComponentsGridAddingNewDataItem" |
| CanUserFreezeColumns="False" |
| Margin="0" |
| Grid.Row="2" |
| Width="870"> |
| <telerik:RadGridView.Columns> |
| <telerik:GridViewComboBoxColumn |
| Header="Component" |
| DataMemberBinding="{Binding FinishedGoodId}" |
| UniqueName="Component" |
| SelectedValueMemberPath="Id" |
| DisplayMemberPath="InventoryNumber"/> |
| <telerik:GridViewDataColumn Header="Qty" DataMemberBinding="{Binding Qty}"/> |
| </telerik:RadGridView.Columns> |
| </telerik:RadGridView> |
C#
| private void FinishedGoodComponentsGridAddingNewDataItem(object sender, GridViewAddingNewEventArgs e) |
| { |
| e.Cancel = true; |
| MessageBox.Show("Add Row Pushed"); |
| /* var finishedGood = (FinishedGood)FinishedGoodsGrid.SelectedItem; |
| var finishedGoodComponent = new FinishedGoodComponent { FinishedGood = finishedGood, FinishedGoodId = finishedGood.Id }; |
| finishedGood.FinishedGoodComponents.Add(finishedGoodComponent);*/ |
| |
| var finishedGoodComponentsGrid = (RadGridView)sender; |
| finishedGoodComponentsGrid.BeginInsert(); |
| //TODO: why I have to do this to make the new row show in edit mode is beyond me. Work with Telerik on this. /*Dispatcher.BeginInvoke( delegate |
| { |
| var row = (GridViewRow)componentGrid.ItemContainerGenerator.ContainerFromItem(finishedGoodComponent); |
| ((GridViewCell)row.Cells[0]).IsCurrent = true; |
| componentGrid.BeginEdit(); |
| } );*/ |
| } |
FYI - I'm using Q3 2009.3 1208