Enabling the Cancel Button

4 posts, 1 answers
  1. Wayne
    Wayne avatar
    4 posts
    Member since:
    Apr 2011

    Posted 17 May 2011 Link to this post

    Hi,

    I've run into a problem with the RadDataForm where I cannot seem to get the Cancel button to become enabled.

    The problem exists in a much more complicated app, but I created a small test app to see if I could get it to work in a very simple implementation, however it still does not.

        <UserControl.Resources>
            <local:ViewModel x:Key="vm"/>
        </UserControl.Resources>

        <Grid x:Name="LayoutRoot" Background="White" DataContext="{StaticResource vm}">
            <telerik:RadDataForm ItemsSource="{Binding Data}"/>
        </Grid>

    Data is an Observable collection defined in the ViewModel. Data is of Type 'DataClass' . Both the ViewModel and DataClass implement INotifyPropertyChanged.

    I've looked at the demo (http://demos.telerik.com/silverlight/#DataForm/FirstLook) where it appears to work, and there doesn't seem to be anything different there from what I have above.
  2. Answer
    Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1194 posts

    Posted 17 May 2011 Link to this post

    Hi Wayne,

    RadDataForm's "Cancel" button is enabled only when your data type implement the IEditableObject interface. It executes the RadDataFormCommands.CancelEdit command that invokes the edited item's CancelEdit() method.

    Regards,
    Ivan Ivanov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Avani
    Avani avatar
    1 posts
    Member since:
    Jun 2015

    Posted 05 Jan in reply to Ivan Ivanov Link to this post

    Hi Ivan,

    My silverlight application is using database first approach of EF. And the entities are being generated so am not able to implement IEditableObject interface. Let me know if there is another way to enable cancel button on RadDataForm while in edit mode.

  4. Stefan X1
    Admin
    Stefan X1 avatar
    735 posts

    Posted 09 Jan Link to this post

    Hi Avani,

    Generally speaking, EntityFramework will generate the corresponding entity class as partial one. Can you please confirm that? If this is so, you should be able to add additional functionality by defining your own partial class that implements the needed interface. You can take a look at the Partial Classes and Methods MSDN topic for further reference.

    Regards,
    Stefan X1
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top