Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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!

  • Moderators
Posted

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

Visit...Bassic Software
Posted

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.

  • Moderators
Posted

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?

Visit...Bassic Software
Posted

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.

  • 2 years later...
Posted

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!

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...