title: Prevent duplicate value in gridcontrol devexpress using data table
body: <p>Fill <code>txtName</code>, <code>txtAddress</code> and press <code>btnSubmit</code> will give and add value to <code>GridControl</code> DevExpress.</p>
  
  <p>This the codes:</p>
  
  <pre><code>DataTable dt;
  
  private void XtraForm1_Load(object sender, EventArgs e)
  {
      dt = new DataTable();
      DataColumn dc1 = new DataColumn("NAME");
      DataColumn dc2 = new DataColumn("ADDRESS");
      dt.Columns.Add(dc1);
      dt.Columns.Add(dc2);
      DataRow dr1 = dt.NewRow();
      gridControl1.DataSource = dt;
  }
  
  private void btnSubmit_Click(object sender, EventArgs e)
  {
      DataRow dr1 = dt.NewRow();
      dr1[0] = txtName.Text;
      dr1[1] = txtAddress.Text;
      dt.Rows.Add(dr1);
      gridControl1.DataSource = dt;
  }
  </code></pre>
  
  <p>The codes above worked properly.</p>
  
  <p>How can I prevent duplicate value when data exist in <code>GridControl</code>? I want to get alert / message box that showing me duplicate value after <code>btnSubmit</code> pressed.</p>