This is a migrated thread and some comments may be shown as answers.

RadDataForm AutoEdit=true leads to stack overflow

3 Answers 144 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
HDC
Top achievements
Rank 1
HDC asked on 10 Apr 2011, 09:58 AM
I have created a simple RadDataForm and bound it to a RadDomainDataSource.

Setting AutoEdit=true leads to stack overflow when navigating and updating.

<Grid x:Name="LayoutRoot">
    <riaControls:DomainDataSource AutoLoad="True" Height="0" Width="0" x:Name="organizationDomainDataSource2" 
                                  QueryName="GetOrganizationsQuery" 
                                  PageSize="20">
        <riaControls:DomainDataSource.DomainContext>
            <my1:ExqiOfficeDomainContext />
        </riaControls:DomainDataSource.DomainContext>
    </riaControls:DomainDataSource>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <telerik:RadDataForm  x:Name="OrganizationsEditor"
                ItemsSource="{Binding ElementName=organizationDomainDataSource2, Path=Data}" 
                AutoGenerateFields="True" 
                AutoEdit="True" 
                AutoCommit="True">
        </telerik:RadDataForm>
    </Grid>
</Grid>

After running the application, click on any navigation button. It will eventually return a stack overflow after remaining blocked for quite some time.

3 Answers, 1 is accepted

Sort by
0
Accepted
Leos
Top achievements
Rank 1
answered on 10 Apr 2011, 01:10 PM
It is working for me, but I am using RadDomainDataSource (you are using MS DomainDataSource).
My code (changed to AutoEdit and AutoCommit) is here:
<navigation:Page.Resources>
        <!-- Domain Data Source -->
        <telerik:RadDomainDataSource x:Name="rdds"
           QueryName="GetUzivatelQuery"
           PageSize="20"
           AutoLoad="True">
            <telerik:RadDomainDataSource.DomainContext>
                <services:NutricisDomainContext/>
            </telerik:RadDomainDataSource.DomainContext>
        </telerik:RadDomainDataSource>
        <!-- DataTemplate pro detail -->
        <DataTemplate x:Key="dt">
            <StackPanel Orientation="Vertical" Margin="5">
                <telerik:DataFormDataField Label="Id:"
                        DataMemberBinding="{Binding Id,Mode=TwoWay}">
                    <telerik:DataFormDataField.Content>
                        <TextBox Text="{Binding Id, Mode=TwoWay}" IsReadOnly="True"/>
                    </telerik:DataFormDataField.Content>
                </telerik:DataFormDataField>
                <telerik:DataFormDataField Label="Nazev:"
                        DataMemberBinding="{Binding Nazev,Mode=TwoWay}"/>
            </StackPanel>
        </DataTemplate>
    </navigation:Page.Resources>
    <Grid x:Name="LayoutRoot">
            <RowDefinition/>
            <RowDefinition Height="170"/>
        </Grid.RowDefinitions>
        <!-- Grid View -->
        <telerik:RadGridView          
          Grid.Row="0"
          IsReadOnly="True"
          Name="rgv"
          ItemsSource="{Binding DataView, ElementName=rdds}"
          AutoGenerateColumns="False">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Id" Width="100"
                        DataMemberBinding="{Binding Id}"  TextAlignment="Right"/>
                <telerik:GridViewDataColumn Header="Název"  Width="200"
                        DataMemberBinding="{Binding Nazev}" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
        <!-- Data Form -->
        <telerik:RadDataForm Grid.Row="1"
         AutoGenerateFields="false"
         ItemsSource="{Binding DataView, ElementName=rdds}"
        EditEnded="RadDataForm_EditEnded"
       DeletedItem="RadDataForm_DeletedItem"                            
       ReadOnlyTemplate="{StaticResource dt}"
       EditTemplate="{StaticResource dt}"
       NewItemTemplate="{StaticResource dt}"
       AutoEdit="True"
       AutoCommit="True"
        />
    </Grid>
</navigation:Page>

Events EditEnded() and DeletedItems() only call rdds.SubmitChanges()
This is working for me (only ID is not displayed after first loading and must be clicked in grid/or moved by prev/next to see it).
Leos
0
Leos
Top achievements
Rank 1
answered on 10 Apr 2011, 01:27 PM
And one note:
RDDS is using property DataView.
Microsoft DDS is using property Data.
0
HDC
Top achievements
Rank 1
answered on 10 Apr 2011, 01:37 PM
Thanks a lot Leos, that fixed this problem.

I actually didn't pay attention that i was using the Microsoft domaindatasource instead of the one from Telerik. It doesn't solve the other problems i mentioned with the QDSCV.

For that issue it is probably related to the other problems you mentioned. Good thing this works now.
Tags
DataForm
Asked by
HDC
Top achievements
Rank 1
Answers by
Leos
Top achievements
Rank 1
HDC
Top achievements
Rank 1
Share this question
or