Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to be able to select a combo box item and by selecting that item it needs to display that selected item in a listview and I need to use LINQ. I have a product table where the product name is shown in the combo box and the entire table in the listview. if there is a tutorial or an article on this I would appreciate a link thank you.
Posted
Comments
Maciej Los 18-Mar-15 8:16am    
What have you tried? Where are you stuck?

1 solution

Sample query could look like:
C#
string pname = ComboBox1.SelectedItem.ToString();
ListView1.ItemsSource = ProductsDataContext.Where(p=>p.ProductName == pname);


CP' articles:
Simple Demo of Binding to a Database in WPF using LINQ-SQL[^]
Data Visualization in WPF with LINQ to SQL and Data Binding[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900