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

.NET / EverLive - Sending updates from a Grid

2 Answers 19 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sam
Top achievements
Rank 1
Sam asked on 26 Sep 2013, 08:26 PM
Hi,

I have created a grid and bound it to data as follows:

I created an Action data class, then:

var actionData = await app.WorkWith().Data<Action>().GetAll().ExecuteAsync();
radGridView1.DataSource = actionData;


This populates the grid, however I want to commit changes back to Everlive.

I'm trying to use:

Action updateAction = new Action();
await app.WorkWith().Data<Action>().Update(updateAction).ExecuteAsync();

However this is not working, I'm sure I am missing something obvious here.

Thanks for any assistance, 

2 Answers, 1 is accepted

Sort by
0
Lyubomir Dokov
Telerik team
answered on 01 Oct 2013, 10:27 AM
Hi Sam,

The code you have seems correct.

What could be the problem:
The Update() method only updates changed properties for the object you supply. For the SDK to know which properties are changed, you must do special implementation in the property setters. You can see it in the Documentation, but basically, you need to do something like this:
public DateTime PublicationDate
{
    get
    {
        return this.publicationDate;
    }
    set
    {
        this.publicationDate = value;
        this.OnPropertyChanged("PublicationDate");
    }
}

For more information, please refer to the Updating section in our .NET SDK documentation.

Regards,
Lyubomir Dokov
Telerik
You've missed the Icenium Visual Studio Integration keynote? It has been recorded and posted here.
Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
0
Sam
Top achievements
Rank 1
answered on 01 Oct 2013, 03:24 PM
Thank you Lyubomir,

I will try that and report back,

Many thanks
Tags
General Discussion
Asked by
Sam
Top achievements
Rank 1
Answers by
Lyubomir Dokov
Telerik team
Sam
Top achievements
Rank 1
Share this question
or