I am using WPF to make a program with DataGrid. I have a Delete button and when I select one row in DataGrid, the button enables and I can use it. So if SelectedIndex is bigger than -1 the button enables. But I found out, the SelectedIndex is set to 0 by default, so it's like the first row is always selected.
Is there any other property of DataGrid I could use? Or is there some other way to make this work?
object. - Daniel Hakimi