WPF Controls - ListView, GridView, DataGrid, TabControl, Label, MVVM Frameworks - MVVM Light

WPF DataGrid - Filtering

WPF DataGrid provides a way to filter its bounded list. In the filter method, you can choose only those items from the list that you want to show in WPF DataGrid. Rest items will be hidden. DataGrid uses ListCollectionView class for filtering list of items. ListCollectionView ListCollectionView is a special class which is used for grouping, sorting, and filter it&#...

Continue Reading

How to Remove Row/Column Header in WPF DataGrid?

WPF DataGrid provides a HeadersVisibility property to hide Row Headers and Column Headers. HeaderVisibility possible values are: All - Both row and column headers are visible. Row - Only row headers are visible and column headers are hidden. Column - Only column headers are visible and row headers are hidden. None - Both row and column headers are hidden. ...

Continue Reading

WPF DataGrid - Common Tasks

Table of Contents Change WPF DataGrid Selected Row Background Color WPF DataGrid Select All Checkbox Change Alternate Row Background Color Change the order (Reorder) of Auto Generated Columns Set Auto Generated Column ReadOnly Change WPF DataGrid Selected Row Background Color To change the background color of selected row of WPF DataGrid, you have two ...

Continue Reading

WPF Interview Questions for Beginners & Advanced - Part 1

1. What is WPF? Windows Presentation Foundation (WPF) is a successor of Windows Forms. WPF is a UI presentation framework for developing Windows based applications. It uses the DirectX technology for rendering their controls on the screen. 2. What are the features of WPF? WPF main features are: WPF is resolution-independent. It uses the hardware accel...

Continue Reading

WPF Interview Questions for Beginners & Advanced - Part 2

21. How can we find resources from ResourceDictionary and apply on controls? ResourceDictionary stored resources as key value pairs and you have a method called FindResource in every control to find the resource from the ResourceDictionary. Every resource is stored as reference type so you have to cast the object to the original type. btn1.Background = (Brush)btn1.Fi...

Continue Reading

WPF Interview Questions for Beginners & Advanced - Part 3

41. What is Markup Extension in WPF? Markup Extension decides at runtime how to set a property value. StaticResource, DynamicResource are examples of Markup Extension. Markup Extension are always comes in curly braces { }. The first word inside the curly braces is class name of Markup Extension. 42. How many types of Markup Extension exists in WPF? There are tot...

Continue Reading

WPF Interview Questions for Beginners & Advanced - Part 4

61. How can you obtain the SynchronizationContext class? You can use the static property SynchronizationContext.Current property from the UI thread. 62. How many methods are available in SynchronizationContext class? There are two methods: Post Send 63. What is the difference between Send and Post methods in SynchronizationContext class? Post method...

Continue Reading

WPF Interview Questions for Beginners & Advanced - Part 5

81. What is Property-based Animation in WPF? WPF introduces a property-based animation techniques to make animations in WPF easy. It simply modify the value of control property over an interval of time and the target property must be a dependency property. 82. How many types of Animation support by WPF? There are baiscally three types of Animation classes. ...

Continue Reading

WPF ComboBox - Tooltip for each item

Many readers ask me a question regarding how we can add a tooltip for each item of ComboBox in WPF. Here I am presenting a very simple solution. In the below example, I am creating a simple combobox. ComboBox DataTemplate defines a ListBoxItem for each item in combobox. ListBoxItem has both Content and Tooltip property.  As we cannot use String.Format in Tooltip bi...

Continue Reading

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