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

Bug With AutoEdit

3 Answers 85 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 08 Aug 2013, 06:23 AM
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>

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 08 Aug 2013, 06:52 AM
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 >>
0
Ian
Top achievements
Rank 1
answered on 08 Aug 2013, 06:57 AM
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 ?


0
Maya
Telerik team
answered on 08 Aug 2013, 07:05 AM
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 >>
Tags
DataForm
Asked by
Ian
Top achievements
Rank 1
Answers by
Maya
Telerik team
Ian
Top achievements
Rank 1
Share this question
or