Refresh specific row in gridview

4 posts, 1 answers
  1. Paul Somberg
    Paul Somberg avatar
    9 posts
    Member since:
    Feb 2009

    Posted 07 Nov 2012 Link to this post

    I have a gridview which is bound to a list of about 50.000 objects. After changing an objects value in the list (in a seperate pop-up) the row is not updated in the grid.

    When I select another row or scroll through the grid, the new value is visible.

    Is there a way to refresh the row I just edited? I've tried to update the complete grid with EndUpdate, but this took about 18 seconds. This is way to long.
  2. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 07 Nov 2012 Link to this post

    Hello Paul,

    If you have an instance of the rowInfo, you can just use the InvalidateRow() method provided by the row.
    grid.Rows[0].InvalidateRow();
    If you don't have the row you can always get it by using linq on the grid.Rows collection.

    You can avoid doing this by binding to a bindinglist and raise the property changed notification event from the changed object.

    If you have any other questions, please let me know.


    Best Regards,
    Emanuel Varga
    Winforms MVP
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 07 Nov 2012 Link to this post

    Here is an example article if needed: http://www.telerik.com/help/winforms/gridview-populating-with-data-reflecting-custom-object-changes-in-rgv.html.

    Regards,
    Stefan
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
  5. Paul Somberg
    Paul Somberg avatar
    9 posts
    Member since:
    Feb 2009

    Posted 07 Nov 2012 Link to this post

    The solution of Emanuel Varga solved my problem.

    Thanks for the replies
Back to Top