We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

SfDataGrid - Cannot add filter

Thread ID:





121352 Dec 4,2015 01:28 PM UTC Dec 4,2015 08:24 PM UTC WPF 1
Tags: SfDataGrid
James Randle
Asked On December 4, 2015 01:28 PM UTC

I'm using the SfDataGrid inside a TabControlEx. When the SfDataGrid is in the first TabItemEx, I can use the Window.Loaded event to set SfDataGrid.ItemsSource and SfDataGrid.View.Filter.

When i place the SfDataGrid into the second TabItemEx, SfDataGrid.View == null during Windows.Loaded and so i cannot set SfDataGrid.View.Filter.

I have attached a project that illustrates the issue.

Many Thanks,

Attachment: sfdatagridAndTabControlEx_c1d57e47.rar

Sivakumar R [Syncfusion]
Replied On December 4, 2015 08:24 PM UTC

Hi James,

You can set the View.Filter  by handling ItemsSourceChanged event. Find the code snippet and modified sample below,

sfDataGridA.ItemsSourceChanged += sfDataGridA_ItemsSourceChanged;
sfDataGridB.ItemsSourceChanged += sfDataGridB_ItemsSourceChanged;

void sfDataGridB_ItemsSourceChanged(object sender, Syncfusion.UI.Xaml.Grid.GridItemsSourceChangedEventArgs e)


    if (sfDataGridB.View != null)

        sfDataGridB.View.Filter = Filter;


void sfDataGridA_ItemsSourceChanged(object sender, Syncfusion.UI.Xaml.Grid.GridItemsSourceChangedEventArgs e)


    if (sfDataGridA.View != null)

        sfDataGridA.View.Filter = Filter;




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon