Click here to Skip to main content
15,881,709 members
Articles / Desktop Programming / WPF

Filtering the WPF DataGrid automatically via the header (inline filtering)

Rate me:
Please Sign up or sign in to vote.
4.81/5 (35 votes)
25 Aug 2009CPOL6 min read 227.9K   10.7K   73  
This will help you create a grid that has inline filtering like you see in DevExpress / Telerik.
<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:Labs.Filtering"
     xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="Labs.Filtering.Window1"
     Title="Window1" Height="468" Width="784" mc:Ignorable="d">
  
  
    <Grid>
        <local:FilteringDataGrid IsFilteringCaseSensitive="False" ItemsSource="{Binding}" IsReadOnly="True" AutoGenerateColumns="True" x:Name="dataGrid1"/>
    </Grid>
</Window>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead RealDolmen
Belgium Belgium
I'm a Technical Consultant at RealDolmen, one of the largest players on the Belgian IT market: http://www.realdolmen.com

All posts also appear on my blogs: http://blog.sandrinodimattia.net and http://blog.fabriccontroller.net

Comments and Discussions