I keep getting this error when I try to call Find()
public void findTxt(string text)
{
BindingSource src = new BindingSource();
src.DataSource = dataGridView1.DataSource;
src.Position = src.Find("p_Name", text); // Specified method is not supported
if (src.Position == 0 && dataGridView1.Rows[0].Cells[2].Value.ToString() == text)
{
MessageBox.Show("Item found!!");
dataGridView1.CurrentCell = dataGridView1.Rows[src.Position].Cells[2];
}
else if (src.Position == 0 && dataGridView1.Rows[0].Cells[2].Value.ToString() != text)
{
MessageBox.Show("Item not found!!");
}
else
{
MessageBox.Show("Item found!!");
dataGridView1.CurrentCell = dataGridView1.Rows[src.Position].Cells[2];
}
}
Edit:
I get that error when calling findText method from another form, However calling this method from the main form doesn't result in such an error.