If I have a DataGrid
in my View
and a Property
in my ViewModel
that represents currently active DataGridRow
(e.g. focused item or clicked item) should I bind my Property to SelectedItem
or CurrentItem
. Say I chose to bind it to SelectedItem
, then What's CurrentItem
for? should I bind another Property to CurrentItem
?
Asked
Active
Viewed 6,975 times
5

samaneh
- 144
- 1
- 10
-
1What is CurrentItem & SelectedItem here? – Sai Kalyan Kumar Akshinthala May 22 '15 at 11:44
-
1@SaiKalyanKumarAkshinthala He is referring to the properties DataGrid.CurrentItem and DataGrid.SelectedItem – bitbonk Aug 03 '16 at 16:24
1 Answers
9
Look at this: DataGrid CurrentItem != SelectedItem after reentry with tab-button
First of all a row is selected by the user which makes the datagrid show that row in the selected way (SelectedItem and also CurrentItem contain the selected object). Then the focus is given to another control. In this status - the selection is still shown - SelectedItem is still there while CurrentItem is null!
Good article: http://docs.telerik.com/devtools/silverlight/controls/radgridview/selection/selecteditem-currentitem.html
-
2This is terrible, not your answer, but Microsoft's design. Does the current day cease to be when I look at my watch. The only time current-anything should be null is at the start when it has yet to be assigned. – Paul McCarthy Dec 10 '19 at 16:40