i used this code to search in datagridview to find and select row ! (no filter)
butt, when datagrid have Repetitive value in row's ---> dont get next row !
How do I put a button to the next row with every click to Btn_find ?
(Find similar Excel)
butt, when datagrid have Repetitive value in row's ---> dont get next row !
How do I put a button to the next row with every click to Btn_find ?
(Find similar Excel)
private void button1_Click(object sender, EventArgs e)
{
button1.Text = "Find Next";
{
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if (row.Cells["ProductId"].Value == null)
{
continue;
}
if (row.Cells["ProductId"].Value.ToString().Trim() == textBox1.Text)
{
dataGridView1.CurrentCell = row.Cells["ProductId"];
dataGridView1.FirstDisplayedScrollingRowIndex = dataGridView1.Rows[row.Index].Index;
return;
}
}
}
}

ramya bharathPosted May 7, 2015, 6:22 AM
So similar way you can store that row index and in the find next skip that first row alone and make the next search as the first.
For example first time you search that row 3 matches and display as first row next time the first row will obviously match skip that and find the next
Instead you can follow this approach .
1. Process each and every row by row index
2. if the keyword matches highlight the row
3. On find next get the highlightedvrow and process from that row index
ghasem dehPosted May 7, 2015, 3:43 AM
this my form : PIC
Dipankar BiswasPosted May 6, 2015, 11:21 PM
see this link to help..http://stackoverflow.com/questions/19444955/getting-next-row-of-table-of-access-database-every-time-on-clicking-a-button
ghasem dehPosted May 6, 2015, 4:18 PM
I do not want to filter ...
But like Excel search and find the next row, the amount is equal
ramya bharathPosted May 6, 2015, 1:52 PM