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
620
Set activeCell/activeRecord based on activeDataItem
posted

I have a grid with columns that contains other grids.

 

I need to be able to programatically set record.isSelected in the one subgrid, that matches my ActiveDataItem, which I am tracking in my ViewModel. Any ideas how to achieve that?

 

Parents
No Data
Reply
  • 12875
    posted

    Hi, 

    I’m attaching a sample showing how to set the selected rows by using Behaviors which extend the viewmodel and allow you to keep the grid and the view models’ SelectedRows collection in sync. 

    There is always only one Active item, while the SelectedRows is a collection.  From your comment I’m not sure if you want to only have one selected row.  Please let me know if you wanted that as well. 

    Let me know if you have any questions.

    WPF_xamDataGrid_Behavior1.zip
Children