Sebastian Salines
Sebastian Salines

Reputation: 81

Determine If Row is Selected in DataGrid

So I have a simple DataGrid with a few fields and I want to put a "Delete row" button. I know how to do everything but check if there aren't any rows selected in the DataGrid..

How would I do that?

Upvotes: 0

Views: 3531

Answers (1)

C-Pound Guru
C-Pound Guru

Reputation: 16368

The .Row property of your grid will return the index of the currently selected row in the grid. If it's < 0, there is no selection.

Upvotes: 1

Related Questions