I have a wpf application that use the MVVM pattern. In code, I set the selectedItem property, that binds the dataGrid property in the axml, and the row has a grey color, instead of blue.
If I select the row with the mouse, then the row is blue.
Why?
I use the binding mode “twoway” for the selectedIndex property.
Thanks.
The gray highlight is probably because it is showing the selected item, but the control itself (the
DataGrid) doesn’t have focus. The same thing occurs withListBoxes. Try putting aTextBoxon your window next to theDataGrid. Select the row with the mouse and it’ll turn blue. Then click in theTextBoxand the selection will turn gray.