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
1060
Finding a row
posted

Hi

Say I have an observablecollection with a few thousand items in it.  This is then set as the itemsource of the xamWebGrid.  If something changes in the code behind to one of the items, and that requires that a different style is applied to the row in the grid that displays that item, then what is the fastest way to establish which row in the grid corresponds to the item that has changed so I can apply a style to it?  To do a foreach on the rowcollection is taking a long time.

Hope that makes sense.

Thanks

Kevin

Parents
No Data
Reply
  • 40030
    Verified Answer
    Offline posted

    Hey Kevin, 

    Yes, there is a very simple way to do this.  We provide an event called CellControlAttached.  This event fires whenever a cell comes into view, and also whenever its underlying data changes (Note the data needs implement INotifyPropertyChanged in order for that to occur). 

    In this event, you can update the styles of the Cells/ Rows based on their values.  And you don't need to worry about traversing all the data, b/c you only need to care about what's currently in view. 

    Hope this helps. 

    -SteveZ

Children