المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Find First Row using WildCard and nonPrimary Column



C# Programming
09-30-2009, 10:30 AM
Hello all,

I am using a DataGridView bound to a DataTable. How can I allow the user to type a letter on the keyboard and have the DataGridView change current row the first occurrence of a letter. For example, a column in the table is Lastname, so typing ‘S’ would bring you to the first Lastname that starts with an S.

I gather the best way would be to search the DataTable then use the result to set the DataGridView.

Note: column to search does not have a primary key as last name is not always unique.

Thanks in advance,
KCI

Get to work!