4
Answers

How to prevent duplicate records in Wpf datagrid?

Hasti Fallah

Hasti Fallah

3y
1.7k
1

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)