본문 바로가기
VB.net/DataGridView

특정 단어가 포함된 행 지우기

by 호야호잇 2018. 11. 23.

            '========= 애플워치 데이터 삭제 로직 =====================

with 데이터그리드뷰

            For i = 0 To .RowCount - 1

                .MultiSelect = True

                If .Rows(i).Cells(1).Value = "APPLE WATCH" Then

                    .Rows(i).Selected = True

                End If

            Next


            For Each Row As DataGridViewRow In .SelectedRows

                If Row.Cells(1).Value = "APPLE WATCH" Then

                    .Rows.Remove(Row)

                End If

            Next

            .MultiSelect = False


end with

            '================================================