Bug With AutoEdit

4 posts, 0 answers
  1. Ian
    Ian avatar
    23 posts
    Member since:
    Jun 2011

    Posted 08 Aug 2013 Link to this post

    Anyone encountered a problem with autoedit not working as intended.

    I wanted to use a dataform as a simple data entry form for a single item. So i have bound my dataform CurrentItem to a single structure and i want it to go straight into edit mode instead of readonly mode.

    If i remove the ReadOnlyTemplate i get a blank form. If i have both with autoedit set to true it defaults to the readonly template (no edit button appears ), but it seems to be selecting the incorrect template (readonly).

    If i have both and turn autoedit false, i starts in readonly and the edit mode button functions correctly, i just want it to be automated so i dont have to manually click the edit button.

    Any ideas what im doing wrong ?

                        <telerik:RadDataForm x:Name="AddSiteDataForm" AutoGenerateFields="False" AutoEdit="True" CurrentItem="{Binding NewSiteNode}" EditTemplate="{StaticResource AddSiteTemplate}" ReadOnlyTemplate="{StaticResource AddSiteTemplate}" >
     
    <DataTemplate x:Key="AddSiteTemplate">
        <StackPanel>
            <telerik:DataFormDataField DataMemberBinding="{Binding SiteName,Mode=TwoWay}" Label="Site Name:" IsEnabled="True" />
            <telerik:DataFormDataField DataMemberBinding="{Binding SiteType,Mode=TwoWay}" Label="Site Type:" IsEnabled="True"/>
            <telerik:DataFormDataField DataMemberBinding="{Binding SiteLatitude,Mode=TwoWay}" Label="Latitude:" IsEnabled="True"/>
            <telerik:DataFormDataField DataMemberBinding="{Binding SiteLongitude,Mode=TwoWay}" Label="Longitude:" IsEnabled="True"/>
            <telerik:DataFormDataField DataMemberBinding="{Binding ProductionRegion,Mode=TwoWay}" Label="Production Region:" IsEnabled="True"/>
        </StackPanel>
    </DataTemplate>
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 08 Aug 2013 Link to this post

    Hi Ian,

    I have tested the behavior like follows:

    <telerik:RadDataForm x:Name="AddSiteDataForm"
                             AutoGenerateFields="False"
                             AutoEdit="True"
                             CurrentItem="{Binding Clubs[0]}"
                             EditTemplate="{StaticResource AddSiteTemplate}" >

    Without specifying ReadOnlyTemplate and everything works as expected. Is that your scenario ? What version are you working with ?  

    Regards,
    Maya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. Ian
    Ian avatar
    23 posts
    Member since:
    Jun 2011

    Posted 08 Aug 2013 Link to this post

    Thanks for the quick reply.

    I am using RadControls for Silverlight, v.2012.2.607.1050

    What you have in your example is what i want to achieve, however with my behavior i just get a blank page unless i set a readonlytemplate despite being autoedit turned on.

    Are you able to post an example project ?


  5. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 08 Aug 2013 Link to this post

    Hi,

    I am attaching the sample I used for the test. It uses binaries from our current official release - Q2 2013 SP. 

    Regards,
    Maya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top