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
305
Selecting a row programmatically when the collection changes
posted

Hi,

 

I have a XamDataGrid that is bound to a collection. In the code behind, I add an item to the collection, which in turn updatesgrid. I want to then select the new item in the grid. The only way I have found that works is to enumerate through the REcords in the grid and compare an identifier. Then, I set the record's IsActive property to true. Seems like there should be something easier.

  • 69686
    posted

    Another way would be to handle the InitializeRecord instead of iterating through the records. Please  note that selecting a record is associated with IsSelected property or adding it in the SelectedItems.Records collection. isActive makes the record active.