kertsman Posted November 13, 2003 Posted November 13, 2003 Hello, I was hoping someone would be able to help me with a problem. I have a form that contains a datagrid bound to a dataset, a textbox and a combobox that is filled with the grid's column names. I want to be able to select a column from the combobox and then type in the textbox. As I type, I want to search the specified grid column for the matching characters. Basically, I want to do something similar to a combobox lookup or autofill, only with a textbox and grid. Is this even possible? If so, please help, this is for a project that is slightly overdue. Thanks for your help! Quote
Moderators Robby Posted November 13, 2003 Moderators Posted November 13, 2003 It is very easily done... In the change event of the search textbox use rowFilter of the Dataview of the Dataset to specify the Where clause, ie.. dv.RowFilter = myCombo.Text & " LIKE '" & myTextBox.text & "%'" 'You need to bind the Grid to the dataview instead of the Dataset Quote Visit...Bassic Software
kertsman Posted November 13, 2003 Author Posted November 13, 2003 Thanks Robby, that will certainly do close to what I want, but do you know if there is a way to do it without filtering the results? Ideally, I still want the user to be able to scroll through the grid with the full dataset listed even if they do a search. Also, The column names I have in the ComboBox are not the actual column names of the table, the ComboBox are plain English instead of the abbreviated I used in the table. Hmmmm... Thanks again, I will give your idea a try it maybe good enough for my boss. Quote
Moderators Robby Posted November 13, 2003 Moderators Posted November 13, 2003 I did the exact thing except instead of a combo I filtered on the last column or cell the user clicked on, eitherway works. If you don't filter you can simply Find an item in the grid, take note on how you want to approach this, will you re-sort by the column they choose or....? You understand where I going with this? Quote Visit...Bassic Software
kertsman Posted November 13, 2003 Author Posted November 13, 2003 Hm, yes I see what you are getting at. What I am doing is after the user selects the record, either through a manual search or hopefully soon a text find, they click a button and a new form open with data populated in the field based ona column from the grid. So, I think the Find method might work, I just need to figure out the Find command for the Grid. Quote
mukesh Posted October 5, 2006 Posted October 5, 2006 I am facing same problem Hello, I want solution for same problem, if you have solution pls help me. Hello, I was hoping someone would be able to help me with a problem. I have a form that contains a datagrid bound to a dataset, a textbox and a combobox that is filled with the grid's column names. I want to be able to select a column from the combobox and then type in the textbox. As I type, I want to search the specified grid column for the matching characters. Basically, I want to do something similar to a combobox lookup or autofill, only with a textbox and grid. Is this even possible? If so, please help, this is for a project that is slightly overdue. Thanks for your help! Quote
gprabaka Posted October 19, 2006 Posted October 19, 2006 Are you basically wanting to scroll up or down to the first occurrance of the text you are searching? Guha Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.