Click here to Skip to main content
14,970,229 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All

I would like to know how i can indicate to the user by a display message the row they searched for in a datagridview is not found.

For instance, i have a textbox and button which i filter the gridview. but i would like to provide a message to the user if the row appears to be empty.

i am using 3tier design so this all will be happening on the presentation layer.

private void btnSearch_Click(object sender, EventArgs e)
      if (txtSearchVisitorSurname.Text == String.Empty)
          MessageBox.Show("Please provide a last name to search for", "Search option", MessageBoxButtons.OK, MessageBoxIcon.Information);
          rdoShowAll.Checked = false;
          dgvAllVisitors.DataSource = bl.GetAllVisitorsBySurname(txtSearchVisitorSurname.Text);
          dgvAllVisitors.ReadOnly = true;

Updated 29-Sep-13 23:52pm
dibyaaryan007 30-Sep-13 5:58am
hello .
what you exactly want?
you want to search the value given in textbox inside grid view with highlight or the value of selected row in message.?
So, what's the issue?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900