Hasti Fallah

Hasti Fallah

  • NA
  • 61
  • 2.6k

How to prevent duplicate records in Wpf datagrid?

Jan 5 2022 9:19 AM

Hi. 

I have Datagrid that I want to check the value it's getting from text box and validate if it's not duplicated records

Then if it's validate it continues posting api into my datagrid

 

Here's my code :

if (txtName.Text==usergrid)
                {
                    MessageBox.Show("channel already exists!");
                    
                }
                else
                {
                    return;
                }

 

Can you please help me what should I add?

Thanks 


Answers (4)