Hello all,
How can I allow a user to type a letter on the keyboard and have a DataGridView (DGV) change current row to the first occurrence of the letter within a non-Primary Key column.
For example, LastName is a column in a DGV. Typing āSā should change the current row of the DGV to the first Lastname that starts with an āSā. Note: LastName is not the primary key of the bound table.
I am using a DataGridView bound to a DataSet.Table[] without a binding source.
Here is a code snippet I tried, but it returns -1:
ds.Tables["Students"].DefaultView.Sort = "LastName";
int intRow = ds.Tables["Students"].DefaultView.Find("S%");
I have also tried this, but it returns zero rows:
ds.Tables["Students"].DefaultView.Sort = "LastName";
DataRowView[] drv = ds.Tables["Students"].DefaultView.FindRows("LastName LIKE 'S'");
Thanks in advance,
KCI