am tryied the below code for checking the sid value,there are two datagrid,
In one datagrid,am select a row and send to another datagrid2 with a tabindex am mentioned here.
First time when am sent means,it want to add to datagrid2.Then if am again the same datarow selected from datagrid1 and send means,it want to show "its already listed in datagrid2" --this is my concept
But when am trying the below code its always shows listed in datagrid3,so how to change the code perfectly for my concept???
public void sendstudy(string sid, DataRow row)
{
this.datatableobject.Rows.Add(row);
dataGrid2.ItemsSource = this.datatableobject.DefaultView;
tabControl1.SelectedIndex = 1;
foreach (DataRowView rowww in dataGrid2.Items)
{
string text = rowww.Row.ItemArray[1].ToString();
if (text == sid)
System.Windows.Forms.MessageBox.Show("ALREADY");
return;
}
}
List<string> results = new List<string>();
if (results.Contains(sid))
{
System.Windows.Forms.MessageBox.Show("Study Already Listed");
return;
}
It must works fine!!!