How to setup a simple DataBinding scenario?

3 posts, 0 answers
  1. Dusan
    Dusan avatar
    9 posts
    Member since:
    May 2013

    Posted 03 May 2013 Link to this post

    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. Dusan
    Dusan avatar
    9 posts
    Member since:
    May 2013

    Posted 03 May 2013 Link to this post

    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();
  3. DevCraft banner
  4. Ralph Waldenmaier
    Admin
    Ralph Waldenmaier avatar
    202 posts

    Posted 06 May 2013 Link to this post

    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 >>
Back to Top