Tutorials - C#, WPF, ASP.NET MVC, WCF, Entity Framework, AngularJS and MVVM Frameworks - MVVM Light - DotNetPattern.com
ListView control is a very popular control among WPF developers. Developers use ListView control for showing the data in tabular format. Sometimes, we need to hide WPF ListView columns, but wpf does not provide any default implementation for hide WPF ListView columns.
I have developed a WPF Behavior to hide WPF ListView columns through Attach property. An attached&...
WPF ListView comes under 10 most important controls in WPF. ListView represents a control in WPF which display a collection of data items. ListView is capable of showing data items in different views. It comes with its default view GridView which show items in tabular format. WPF ListView contains almost same features as ListBox as it is inherit from ListBox control.
WPF Listview is a control that is used for display a list of data items. It inherits directly from ListBox. Listview provides an ItemsSource property for binding list of items. Below is the sample program for binding listview items.
WPF ListView ItemTemplateSelector is used for choosing a DataTemplate for each ListViewItem at runtime. You can provide a custom logic to choose which DataTemplate to use in list view item.
When to use?
You have to show different UIs for each ListViewItem based on some condition. But using the ItemTemplate you can only set only one DataTemplate which is used by every List...
ListView ItemContainerStyle specifies a style that is used by every generated ListViewItem for styling it.
You can create a Style inline or in the Resources section and set the ItemContainerStyle property of ListView. You can set ItemContainerStyle as StaticResource or DynamicResource.
When to Use?
By default you cannot modify style of ListViewItem in WPF ListView....
WPF ListView does not support Filtering by default. ListView does not have their own methods to filter the bounded list.
But WPF has a very special class CollectionViewSource which supports Filtering very effectively and in very easy way.
What is CollectionViewSource class?
CollectionViewSource is a class which we can use in WPF for filtering and sorting a bounded ...
WPF ListView is a very popular tool for showing list of items. Sometimes we need to hide the ListView column headers and only show the list of items.
But ListView does not provide any default behavior or property for hiding the column headers.
By applying a simple style you can hide the column headers of WPF ListView.
WPF provides various templates for customization of controls. WPF ListView ItemTemplate is in one of these. ItemTemplate of ListView is useful when we have to change the visual presentation of bound data objects.
If your WPF ListView control is bound to collection of objects using ItemsSource proeprty and you have not set the ItemTemplate property, then it will call the...
Label control is used for showing the text data in the WPF application. It also provides support for Access Keys.
Label is directly inherit from ContentControl class which provides the Content property to Label control.
In the Content property, you can set the string or host any type of child control.
To build more responsive WPF UI, we have to use multiple threads that can work in the background and update the UI when the work completed.
But background threads can't access the objects created in the STA. Then how can we update the UI when the background threads completed their work?
WPF applications are based on Single Threaded Apartment Model (STA). Ob...