This question is locked. New answers and comments are not allowed.
Hello,
I'm receiving an invalid operation exception when I try to add an item with a dataform, when RadGridView IsReadOnly="True"
I have a master detail scenario where the data should be maintain within a dataform and not directly within the grid. But when I don't set IsReadOnly="True" for the grid the app crashes with the following exception.
Error: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
at Telerik.Windows.Controls.GridView.GridViewRow.<BeginEdit>b__b()
Below you can see the XAML which I've used. I've checked this also with the Microsoft DataGrid, as you can see in the XAML code and there it works without any problems. May be you can tell me, how this master detail scenario can be done also with the Telerik grid.
Thanks for your support
Bye
Uwe
I'm receiving an invalid operation exception when I try to add an item with a dataform, when RadGridView IsReadOnly="True"
I have a master detail scenario where the data should be maintain within a dataform and not directly within the grid. But when I don't set IsReadOnly="True" for the grid the app crashes with the following exception.
Error: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source, Func`2 predicate)
at Telerik.Windows.Controls.GridView.GridViewRow.<BeginEdit>b__b()
Below you can see the XAML which I've used. I've checked this also with the Microsoft DataGrid, as you can see in the XAML code and there it works without any problems. May be you can tell me, how this master detail scenario can be done also with the Telerik grid.
| <Grid x:Name="LayoutRoot"> |
| <dds:DomainDataSource x:Name="ddsTest" QueryName="GetCustomersTest" AutoLoad="True"> |
| <dds:DomainDataSource.DomainContext> |
| <domain:DomainService1/> |
| </dds:DomainDataSource.DomainContext> |
| <dds:DomainDataSource.SortDescriptors> |
| <riaData:SortDescriptor PropertyPath="CustomerID" Direction="Ascending"/> |
| </dds:DomainDataSource.SortDescriptors> |
| </dds:DomainDataSource> |
| <StackPanel x:Name="ContentStackPanel" Style="{StaticResource ContentStackPanelStyle}"> |
| <dataform:DataForm |
| ItemsSource="{Binding Data, ElementName=ddsTest}" |
| CurrentItem="{Binding SelectedItem, ElementName=TestList, Mode=TwoWay}" |
| AutoGenerateFields="True" |
| AutoEdit="True" AutoCommit="True" CommandButtonsVisibility="Add,Delete" |
| > |
| </dataform:DataForm> |
| <telGrid:RadGridView x:Name="TestList" ItemsSource="{Binding Data, ElementName=ddsTest}" |
| IsReadOnly="True" AutoGenerateColumns="True" |
| > |
| </telGrid:RadGridView> |
| <!--<datagrid:DataGrid x:Name="TestList" ItemsSource="{Binding Data, ElementName=ddsTest}" |
| IsReadOnly="True" AutoGenerateColumns="True" |
| > |
| </datagrid:DataGrid>--> |
| </StackPanel> |
| </Grid> |
Thanks for your support
Bye
Uwe