2
我已閱讀有關此主題的帖子的分數,但沒有一個似乎解決了我的特定問題。我正在使用一個帶有vb的wpf網格。這是我的事件處理程序:如何從DataGridCellInfo檢索行索引
Private Sub dgrdMain_SelectedCellsChanged(sender As Object, e As SelectedCellsChangedEventArgs) Handles dgrMain.SelectedCellsChanged
If e.RemovedCells.Count > 0 Then
Dim ilRemovedCells As IList(Of DataGridCellInfo) = e.RemovedCells
For Each rc As DataGridCellInfo In ilRemovedCells
rc.Column.DisplayIndex 'This gives the column index
'How do I get the row index?
Next
End If
這裏rc =已刪除的單元格。我的問題是上面的註釋行。
優秀,Codexer。 – SezMe
很高興爲你工作。 – Codexer