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

Enabling the Cancel Button

3 Answers 130 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Wayne
Top achievements
Rank 1
Wayne asked on 17 May 2011, 08:41 AM
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.

3 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Ivanov
Telerik team
answered on 17 May 2011, 10:51 AM
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
0
Avani
Top achievements
Rank 1
answered on 05 Jan 2017, 02:33 PM

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.

0
Stefan
Telerik team
answered on 09 Jan 2017, 05:03 PM
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.
Tags
DataForm
Asked by
Wayne
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Avani
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or