Guys I have created a simple datagridview through toolbox and selected data through wizard (no code in .cs file) from database. It is working flawlessly as you can see in th
Try this:
foreach (System.Windows.Forms.DataGridViewRow r in MyGridView.Rows)
{
if ((r.Cells[5].Value).ToString().ToUpper().Contains(searchText.ToUpper()))
{
MyGridView.Rows[r.Index].Visible = true;
MyGridView.Rows[r.Index].Selected = true;
}
else
{
MyGridView.CurrentCell = null;
MyGridView.Rows[r.Index].Visible = false;
}
}