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

How to setup a simple DataBinding scenario?

2 Answers 48 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dusan
Top achievements
Rank 1
Dusan asked on 03 May 2013, 02:20 PM
Hi,

As of yesterday I started implementing OA ORM in WinForms project and while all my initial efforts were rather successful I came across following scenario (...newbie alert...). Upon creating a new entity object and populating some of its properties, I need to be able to see these values instantly in all corresponding data-bound controls.

Is this even technically possible before such data row is saved within it's context? 

Thanks for letting me know,
Dusan

2 Answers, 1 is accepted

Sort by
0
Dusan
Top achievements
Rank 1
answered on 03 May 2013, 03:27 PM
After experimenting with code I have found a solution that does the trick. Here's the code:

            var c = new Contract();
            c.ID = "1234567";
            dbContext.Add(c);
            dbContext.FlushChanges();
            objectProvider1.Refresh();
            objectView1.MoveLast();
0
Ralph Waldenmaier
Telerik team
answered on 06 May 2013, 12:44 PM
Hello Dusan,

I am glad that you found the solution. By flushing the data to the database you(as the name suggests) flush the data to the database but the transaction is not committed yet. Also the primary key, if database server calculated, is then obtained from the database. You can find more details here

Feel free to ask in case you have any other question.

Regards,
Ralph
the Telerik team
OpenAccess ORM Q1'13 SP1 update is out now. Take a glimpse at the highlights >>
Tags
Data Access Free Edition
Asked by
Dusan
Top achievements
Rank 1
Answers by
Dusan
Top achievements
Rank 1
Ralph Waldenmaier
Telerik team
Share this question
or