Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
610
Refresh Cell In Grid Bound To An Object That Doesn't Implement INotifyPropertyChanged
posted

Hello,

 I have an object that I unfortunately can't change that doesn't implement INotifyPropertyChanged that is being bound to the xamGrid.  When I add or delete from the collection, the grid updates.  When I update the object, it doesn't update, unless I set the ItemSource to Null and then re-bind.  I also found you can select the cell and or start editing the cell and then cancel the update which is forcing the grid to refetch just that cell. 

Re-binding the whole grid isn't ideal - it looses position of the current selection, and has high overhead I'd imagine.  Selecting the cell and or editing them is kind of a hack.  Is there any other way to force a cell to rebind or refresh from the data source?

 Thanks

 

Parents
No Data
Reply
  • 40030
    Offline posted

    Hi

    If you can get a reference to the Cell. You can call it's Refresh() method. 

    grid.Rows[0].Cells["YourCOlumnKey"].Refresh();

    Although, it'd definitely be better if you can find a way to implement INotifyPropertyChanged, as that is basically free and requires no additional handling. And one of the core features of SL.

    -SteveZ

Children