Tutorials - C#, WPF, ASP.NET MVC, WCF, Entity Framework, AngularJS and MVVM Frameworks - MVVM Light

WPF ListView - GridView, Bindings, ItemTemplate Examples

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. ...

Continue Reading

WPF ListView - Hide Column Headers by simple Style

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. <Grid> <ListView x:Name="List...

Continue Reading

WPF ListView ItemTemplate Tutorial

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...

Continue Reading

Quick Tips to use WPF ListView ItemTemplateSelector

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...

Continue Reading

WPF MVVM Introduction

Today writing large WPF application is very complex task. WPF application composed of many complex UI designs, larget set of business objects, data storage objects and presentation logic which makes the development of WPF application quite cumbersome. Microsoft introduced a new pattern "MVVM" to make the development of WPF application easier. MVVM is an arc...

Continue Reading

WPF Tab Control - Close Button

A very common requirement in TabControl is to show a close button (X) near the end of header of each TabItem. We can use ItemTemplate to customize the header section and show a close button (X) at the end of TabItem header. Close Button Example <Grid> <Grid.Resources> <DataTemplate x:Key="CustomHeaderTemplate"> <DockPanel Last...

Continue Reading

WPF Tab Control - FlowDirection

FlowDirection in WPF TabControl is used for setting the content flow direction of UI elements in header and content area.  FlowDirection is an enum which has only two values: LeftToRight (Default) RightToLeft LeftToRight By default, any TabControl set the FlowDirection property to LeftToRight. In this, all the UI controls in header and cont...

Continue Reading

WPF Tab Control - Selection

TabControl provides two main properties for selection of Items. SelectedItem SelectedIndex TabControl SelectedItem SelectedItem property is used for getting and setting the selected object of WPF TabControl. You bind item list into the ItemsSource property of TabControl and set the SelectedItem property to object which you want to selected first. <Ta...

Continue Reading

WPF Tab Control - TabStripPlacement

TabStripPlacement is an important propety of TabControl. It is used for setting the Header alignment relative to tab content. You can set below four values in TabStripPlacement. Left Top (Default) Right Bottom I have given all four examples of TabStripPlacement. Left Set header to left position like below: <TabControl x:Name="TabC...

Continue Reading

WPF Tab Control - Templates

WPF TabControl provides two templates property for changing the UI for Header and Content area. ItemTemplate - Get/Set DataTemplate for TabItem Header. ContentTemplate - Get/Set DateTemplate for TabItem Content. ItemTemplate ItemTemplate is used for changing the DataTemplate of Header section of TabItem. By default, Header DataTemplate call the ToString meth...

Continue Reading

Join our newsletter and get an occasional email with a technology and dotnetpattern.com news update.