Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
5
Answers
how do excel find in datagridview !?
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
ghasem deh
9y
496
1
Reply
hi
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)
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;
}
}
}
}
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
Load Image from handler using JQuery
how can display data in grid-view or listview from multi XML