DataGridView that searches like outlook
-
Does the datagridview in vs2005 work like outlook. ie I know it works the same when you click the column headings but in outlook you can move to rows in that column by pressing say 's' to move the record selector to the beginning of all the 'S' in the column you have just ordered by. if it does how do you active that functionality. If not is there one can buy that will do the same?
-
Does the datagridview in vs2005 work like outlook. ie I know it works the same when you click the column headings but in outlook you can move to rows in that column by pressing say 's' to move the record selector to the beginning of all the 'S' in the column you have just ordered by. if it does how do you active that functionality. If not is there one can buy that will do the same?
robmays wrote:
If not is there one can buy that will do the same?
Wow! You go for the cash pretty quickly!!:) Even though DataGridView doesn't support this feature natively, you can make it by two simple steps: 1- Change the
DataGridView.EditMode
toEditOnEnter
for example -ie. Anything that doesn't include KeyStroke-. 2- Handle theDataGridView.KeyPress
event -or any other key event-, and put the code that goes through the rows -using a foreach loop- to check your desired column if it starts with the specific key the user entered. PS. You can add the feature of supporting two-or three strokes search -like the windows explorer. ie. searching for "sam" not just "s"-, by storing the keystrokes in a temp string and clear that string after a small timer elapse to start over a new search if the user presses a key.Regards:rose:
-
robmays wrote:
If not is there one can buy that will do the same?
Wow! You go for the cash pretty quickly!!:) Even though DataGridView doesn't support this feature natively, you can make it by two simple steps: 1- Change the
DataGridView.EditMode
toEditOnEnter
for example -ie. Anything that doesn't include KeyStroke-. 2- Handle theDataGridView.KeyPress
event -or any other key event-, and put the code that goes through the rows -using a foreach loop- to check your desired column if it starts with the specific key the user entered. PS. You can add the feature of supporting two-or three strokes search -like the windows explorer. ie. searching for "sam" not just "s"-, by storing the keystrokes in a temp string and clear that string after a small timer elapse to start over a new search if the user presses a key.Regards:rose:
-
excellent ,dont like to spend money. can you give me some simple c# code to steer me in the right direction? that you would use in the events.
Ummm.... Did you notice point number 2 in my previous post? What is it that's not clear about it?
Regards:rose: