RadDataForm AutoEdit=true leads to stack overflow

4 posts, 1 answers
  1. HDC
    HDC avatar
    214 posts
    Member since:
    Dec 2010

    Posted 10 Apr 2011 Link to this post

    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.
  2. Answer
    Leos
    Leos avatar
    57 posts
    Member since:
    Jul 2010

    Posted 10 Apr 2011 Link to this post

    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
  3. DevCraft banner
  4. Leos
    Leos avatar
    57 posts
    Member since:
    Jul 2010

    Posted 10 Apr 2011 Link to this post

    And one note:
    RDDS is using property DataView.
    Microsoft DDS is using property Data.
  5. HDC
    HDC avatar
    214 posts
    Member since:
    Dec 2010

    Posted 10 Apr 2011 Link to this post

    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.
Back to Top