Update GridView after adding an item

2 posts, 0 answers
  1. Manfred
    Manfred avatar
    54 posts
    Member since:
    Jan 2011

    Posted 08 Apr 2013 Link to this post

    Hi there,

    I have a connection to a MySQL-database and created my classes via EntityFrameWork.
    I bound my GrdiView to one of the tables.

    If I add a new object to the table, my GridView is not updated, until I reorder the items.
    How can I update my GridView without using codebehind, because I am using MVVM for this project.

    Best Regards
    Manfred
  2. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 11 Apr 2013 Link to this post

    Hello,

    RadGridView has two ways of sensing changes in the source collection and updating the UI respectively.

    1. If the source collection implements the INotifyCollectionChanged interface , RadGridView will automatically trigger an update to the UI.

    2. For cases where it is not possible to have the source collection implement the INotifyCollectionChanged interface , a manual call to the Rebind() method of RadGridView is required.


    All the best,
    Pavel Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top