I have got a listbox and I have to populate that with the elements from the query. The query is,
var query = from b in context.table select b;
List<Tab> reclist = q.ToList();
using LINQ how can I print all the obtained values in the listbox?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’ll need to create a
DataTemplatecontaining aTextBlockwhoseTextproperty you bind to a property on your object. So, some XAML something like;Presuming your
Tabclass has a property calledName. Obviously if it doesn’t you’ll want to change the{Binding Name}portion of the XAML to match the property name that you want to display in theListBox.You then bind to your item;