سلام به همه ...
من با این کد تو گریدویو جستجو رو انجام میدم :
private int searchIndex = -1;
private void buttonX1_Click(object sender, EventArgs e) // جستجو در در گریدویو
{
buttonX1.Text = "یافتن بعدی";
try
{
for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
searchIndex = (searchIndex + 1) % dataGridView1.Rows.Count;
DataGridViewRow row = dataGridView1.Rows[searchIndex];
if (row.Cells[1].Value == null)
{
continue;
}
if (row.Cells[1].Value.ToString().Trim().StartsWith(Txt_Software.Text) || row.Cells[1].Value.ToString().Trim().Contains(Txt_Software.Text))
{
dataGridView1.CurrentCell = row.Cells[1];
dataGridView1.FirstDisplayedScrollingRowIndex = dataGridView1.Rows[row.Index].Index;
row = dataGridView1.Rows[i];
return;
}
}
}
catch { }
}
منتها یه مشکل داره ... بین کلمات انگلیسی ، حروف کوچیک و بزرگ فرق میزاره !
چیکار کنم که فرقی نباشه !؟