ListOfPeople.Add(Something.Trim());
foreach (var row in dataGridView2.Rows.Cast<DataGridViewRow>()) { ListOfPeople[row.Index] = row.Cells[0].Value.ToString().Trim(); }
int index = this.ListOfPeople.BinarySearch(textBoxBinarySearch.Text); if (index != -1) { dataGridView2.SelectionMode = DataGridViewSelectionMode.RowHeaderSelect; dataGridView2.Rows[index].Selected = true; dataGridView2.CurrentCell = dataGridView2.Rows[index].Cells[0]; MessageBox.Show("Index is equal to: " + index, "Binary Search"); textBoxBinarySearch.Clear(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)