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

Databinding Enum values to DataForm

3 Answers 115 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Joe Brinkman
Top achievements
Rank 2
Joe Brinkman asked on 17 Jan 2013, 12:50 AM

  I am having some problems with getting Telerik dataforms to work correctly.  Everything seems fine, except that any field which is an Enum does not want to persist it's values back to the original entity.  So I can create new entities and edit existing entities, but the enum fields are uneditable.

I have tried letting the data form auto create the fields, I have tried specifying the fields in XAML, I have tried using a simple viewmodel with auto-implemented fields and tried using a backing store with INotifyPropertyChanged events. 

Nothing works.  The setter on the enum fields is just never called, although I can trace the setter on every other field getting called.


Entity Code
:

public class EventTile

    {

        [GenericListEditor(typeof(EventTypeInfoProvider))]

        public string EventType { get; set; }

        public string Title { get; set; }

        public DateTime EventDate { get; set; }

        public TileSizeEnum TileSize { get; set; }

        public TileTypeEnum TileType { get; set; }

    }

Save Method on DetailsPage.xaml.cs

        private void Save_Click(object sender, EventArgs e)

        {

            radDataForm.Commit();

            App.ViewModel.SaveEventTiles();

            NavigationService.GoBack();

        }

XAML

<telerikInput:RadDataForm x:Name="radDataForm" >

    <Grid>

        <telerikInput:DataField TargetProperty="Title"/>

        <telerikInput:DataField TargetProperty="EventType"/>

        <telerikInput:DataField TargetProperty="EventDate"/>

        <telerikInput:DataField TargetProperty="TileSize"/>

        <telerikInput:DataField TargetProperty="TileType"/>

    </Grid>

</telerikInput:RadDataForm>

In no case can I get the TileSize or TileType values to be updated correctly. Every other field works as expected. Any help would be appreciated.

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 17 Jan 2013, 08:58 AM
Hi Joe,

Thanks for writing.

We are using RadDataForm in a couple of our projects with very similar scenarios and we cannot reproduce the behavior that you describe.

The first thing that comes to my mind is that if you have defined any type of validation that does not succeed, the Commit method will not store the editors' values to the corresponding properties. It seems that this behavior might be specific to your particular scenario and therefore we would kindly like to ask you to prepare a simple demo project that we can use to reproduce it and see what actually happens.

Note that you will have to open a new support ticket in order to attach your project.

Greetings,
Deyan
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Oladipo
Top achievements
Rank 1
answered on 23 Jan 2014, 09:06 AM
Hi Joe,

Did you finally resolve the issue?

I also have the same issue binding an enum to the raddataform.

The values selected are not being persisted to my currentitem backing model.

Other non enum fields get persisted.

Any updates?
0
Deyan
Telerik team
answered on 24 Jan 2014, 09:27 AM
Hello Oladipo,

Thanks for writing.

We actually never managed to reproduce the problem on our side. Is it possible that you prepare a sample project and send it to us for further investigation?

As soon as we are able to identify the issue and find the reason for it, we will make sure to issue a fix.

Regards,
Deyan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
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
Joe Brinkman
Top achievements
Rank 2
Answers by
Deyan
Telerik team
Oladipo
Top achievements
Rank 1
Share this question
or