grouchyfd
asked on
How do I bind a datagrid to a listbox selected item?
This is for VS2005.
I have one dataset created from a view created from 2 tables. I want the user to select a unit from the listbox and and then the datagridview will show what product is on that unit. I can do this by using a textbox.text property thru a button_click event where the user has to type in the actual unit name. I would like the listbox to show all the units when the form loads and the then the user to select the unit to show the list. I added the query, using @Unit as the variable in the query, FillByUnit.
CustomrerTableAdapter.Fill ByUnit(Dat aset.Datat able, UnitNameListBox.SelectedIt em)
This doesn't seem to work.
Thanks
I have one dataset created from a view created from 2 tables. I want the user to select a unit from the listbox and and then the datagridview will show what product is on that unit. I can do this by using a textbox.text property thru a button_click event where the user has to type in the actual unit name. I would like the listbox to show all the units when the form loads and the then the user to select the unit to show the list. I added the query, using @Unit as the variable in the query, FillByUnit.
CustomrerTableAdapter.Fill
This doesn't seem to work.
Thanks
use DataView
ASKER
I don't understand. This is not a property of my listbox. Could you please explain a little more in depth?
Thanks
Thanks
do you bind your DataGrid to a DataSet?
ASKER
Yes I did.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Because I'm using a view instead of a table I should use the dataview. That should work because I don't want the user to be able to edit anything.