0

how can I search in a gridview and just show the result with paging in it instead of whole data in gridview?

I wrote this code to search:

foreach (DataGridViewRow row in Reserve_dataGridView.Rows)
        {
            if (row.Cells["Cardserial"].Value.ToString().Equals(textBox1.Text))
            {
                Reserve_dataGridView.Rows[row.Index].DefaultCellStyle.BackColor = Color.Yellow;
            }
saadat rahimi
  • 127
  • 4
  • 10

1 Answers1

0

There's a simple answer by Rick Mohr on how to do this using BindingNavigator and BindingSource.

You may also want to look at some other articles/implementations on CodeProject.

Community
  • 1
  • 1
Chibueze Opata
  • 9,856
  • 7
  • 42
  • 65