Skip to main content

AccessTr.neT


Vb.net Datagridview Mükerrerleri Teke Düşürme.

Vb.net Datagridview Mükerrerleri Teke Düşürme.

#6
Ali Can hocam alttaki kodla sorunu hallettim.
Verdiğiniz kodun
 başına
Kod:
Me.DataGridView1.AllowUserToAddRows = True
sonunada
Kod:
Me.DataGridView1.AllowUserToAddRows = False
ekledim.

Teşekkürler yadım için.

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Me.DataGridView1.AllowUserToAddRows = True 'Satir ekleme olayini iptal eder ayarlardaki
        Dim satır = DataGridView1.Rows.Count - 1
        Dim x As Integer = 0
        While x < satır - 1
            For y As Integer = (satır - 1) To (x + 1) Step -1
                If DataGridView1.Rows(x).Cells(0).Value.ToString() = DataGridView1.Rows(y).Cells(0).Value.ToString() Then
                    DataGridView1.Rows.Remove(DataGridView1.Rows(y))
                    satır -= 1
                End If
            Next
            x += 1
        End While
        Me.DataGridView1.AllowUserToAddRows = False
    End Sub
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Cvp: Vb.net Datagridview Mükerrerleri Teke Düşürme. - Yazar: feraz - 03/05/2017, 20:45
Task