HOW TO FIND DUPLICATE VALUES IN DEVEXPRESS GRIDVIEW

Demir ACAR

Total Post:11

Points:77
Posted by  Demir ACAR
C#
 7411  View(s)
Ratings:
Rate this:

hi guys ;

I have country column and I wanna check it for duplicate record

thank in advance .

  1. Sunil Singh

    Post:44

    Points:316
    Re: how to find duplicate values in devexpress gridview

    Hello,

    To obtain an old cell's value, call the GridView.GetRowCellValue method in the GridView.CellValueChanging event handler:

    [C#]Open in popup window
    void gridView1_CellValueChanging(object sender, CellValueChangedEventArgs e) {
        object value = gridView1.GetRowCellValue(e.RowHandle, e.Column);
    }

    [VB.NET]Open in popup window
    Private Sub gridView1_CellValueChanging(ByVal sender As Object, ByVal e As CellValueChangedEventArgs)
        Object value v = gridView1.GetRowCellValue(e.RowHandle, e.Column)
    End Sub

    A new value is available in the e.Value parameter.

    Let me know if this solution meets your requirements.

  1. Demir ACAR

    Post:11

    Points:77
    Re: how to find duplicate values in devexpress gridview

    I applied


    Private void gridView1_CellValueChanging(object sender, CellValueChangedEventArgs e)

     {
        object value = gridView1.GetRowCellValue(e.RowHandle, e.Column);
    }

    Buton Click Code like Below

    if(value=Duplicate)

    {

    MessageBox("Duplicate Record Found");

    }

    else

    {

    //Something Do

    }

    how to use your's code on buton_click event .

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!