Click here to Skip to main content
14,920,935 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I Have a view which displays a DataGrid lets say View1, and the DataGrid CellStyle is binding to a defined style where the property IsSelected gets triggered when Value=True to change background color indicating the cell rows has been selected. The View1 binds to a ViewModel1 where the itemsSource of the Datagrid binds a observableCollection, another view lets says View2 is a control that has different button (Edit/Copy/Delete) which binds to ViewModel1 as well and binds to the commands to delete a row from DataGrid/ Copy a row to DataGrid etc... The question I have when I select an existing row on DataGrid the Propery IsSelected gets triggered to change row background indicating row has been selected, but what I want to do is when I add a new row to the DataGrid by inserting new defined object to ObservableCollection that gets displayed on DataGrid how can I make the new added row be triggered as the selected row once it gets added to the DataGrid so that its background is changed indicating its the new selected row.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900