I have a datagridview in c# with rows , i need to bring the item which is select from combobox ..If value of combobox matches with datagridview particular cell then it should come at first.
How to achieve the same in C#.net forms app ?
Upload an image:
Below im searching for productname which is available in datagridview column cell 2 , I achieved the result with following code :
String searchValue = cmbProductName.Text; int rowIndex = -1;
foreach (DataGridViewRow row in dgvBarcodePrinting.Rows)
rowIndex = row.Index;
dgvBarcodePrinting.Rows[rowIndex].Selected = true;
dgvBarcodePrinting.FirstDisplayedScrollingRowIndex = dgvBarcodePrinting.SelectedRows.Index;