Can any one give me the difference between Itemsource and DataContext of Listview in WPF?
With example
Can any one give me the difference between Itemsource and DataContext of Listview in
Share
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.
The item source (which must impliment IEnumerable)
will be used to create the list of items that appears inside the list. The DataContext (which can be any object) is the default object to bind against for any bindings that you have specified for other properties on the ListView.
Will produce a list of “Item1″, Item2″, Item3” displayed with a width of 23.