Showing inserted row

2 posts, 0 answers
  1. Michael
    Michael avatar
    19 posts
    Member since:
    May 2015

    Posted 07 Dec 2016 Link to this post



    I have an EntityFramework table as my ItemsSource:

    Ent = new Data.xEntities();
    RadViewGrid.ItemsSource = Ent.Table;

    If I insert a row from the "new row" row in the grid it disappears an does not show in the grid. Even if I Rebind() the grid.

    If I


    it works. But I would like to save all changes at once via a Save Button.

    How can I make the inserted row show in the grid without committing it back to the db? Thanks.


  2. Stefan
    Stefan avatar
    1073 posts

    Posted 12 Dec 2016 Link to this post

    Hi Michael,

    The control does not provide an out-of-the-box approach for meeting such requirement. A possible solution for it, would be to use an in-memory collection that will serve as a proxy between the UI and the database.  By doing so, you will be able to insert the newly added items in the database at later state, but still be able to populate and edit them in the UI. For example, if you utilize an ObservableCollection as a source collection of RadGridView, you can subscribe to its CollectionChanged event and implement your insertion logic within the event handler.

    Would such approach satisfy your needs?

    Stefan X1
    Telerik by Progress
    Telerik UI for WPF is ready for Visual Studio 2017 RC! Learn more.
Back to Top