'How To Goto Last Row After Deleted a Datagridview Row
Dim SelectedBillDetailRow As Integer = 0
SelectedBillDetailRow = Datagridview1.SelectedCells.Item(0).RowIndex
'Delete Some Row...
'And..
'Fill...
If SelectedBillDetailRow = Datagridview1.Rows.Count Then
SelectedBillDetailRow = SelectedBillDetailRow - 1
End If
'Goto Selected Row
If SelectedBillDetailRow > 0 And SelectedBillDetailRow <= Datagridview1.Rows.Count And Datagridview1.Rows.Count > 0 Then
Datagridview1.CurrentCell = Datagridview1(0, SelectedBillDetailRow)
End If
ไม่มีความคิดเห็น:
แสดงความคิดเห็น