Home > DeveloperSection > Forums > how to find duplicate values in devexpress gridview
Demir ACAR
Demir ACAR

Total Post:11

Points:77
Posted on    October-09-2015 1:33 PM

 C# Devexpress Windows UI 
Ratings:


 2 Reply(s)
 6319  View(s)
Rate this:

hi guys ;

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

thank in advance .



Sunil Singh
Sunil Singh

Total Post:11

Points:77
Posted on    October-10-2015 4:16 AM

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.

Demir ACAR
Demir ACAR

Total Post:11

Points:77
Posted on    October-10-2015 6:28 AM

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 .


Don't want to miss updates? Please click the below button!

Follow MindStick