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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Filter function

Thread ID:

Created:

Updated:

Platform:

Replies:

96050 Aug 18,2010 11:21 AM UTC Sep 7,2010 04:02 AM UTC WPF 5
loading
Tags: GridControl
jungjin Park.
Asked On August 18, 2010 11:21 AM UTC

Hi,

I used Syncfusion wpf grid version 8.304.0.21.
There are 2 queston.

1. Are FilterPane window location movement possible?
Filter panel become pop-up inside Grid. So hides a contents.
2. I want to use CollectonVew Filter.
I want input receiving from different text box.


public string SearchText
{
set
{
CollectionView collectionView = this.DataGrid.ItemsSource as CollectionView;
if (collectionView == null) return;

collectionView.Filter = (item) =>
{
if (item as ViewModel == null) // data class
return false;

ViewModel vm = (ViewModel)item;
if (vm as ViewModel == null)
return false;

if (vm.Name.ToLower().Contains(value.ToLower()))
{
return true;
}
return false;
};

this.OnPropertyChanged("SearchText");
}

filter is not but i don't know a cause.

Jeraldes J [Syncfusion]
Replied On August 25, 2010 01:42 PM UTC

Hi

Thank you for your interest in Syncfusion products.

Question #1:

We have developed in the way the filter is set to be placed in the right as default manner. This is done in the code processing itself.

Question #2:

You have to place this code in the ItemsSourceChanged event. Then only the collection will be checked in that by using the Model.View you can set the values to the filter.

Let us know if you need any other details.

Regards,
Jeraldes J

jungjin Park.
Replied On August 26, 2010 05:24 AM UTC

Hi.

Thanks for your reply.
My Code is changed.

public string SearchTextRPTID
{
set
{
ICollectionViewAdv collectionView = this.DataGridRPTID.Model.View;
if (collectionView == null) return;

collectionView.Filter = (item) =>
{

if (item as RPTIDViewModel == null)
return false;

RPTIDViewModel vm = (RPTIDViewModel)item;
if (vm as RPTIDViewModel == null)
return false;

if (vm.RPTID.ToString().Contains(value))
return true;

return false;
};

this.OnPropertyChanged("SearchTextRPTID");
}

}
The once operates well.
But frequently occurs error.
Error :
System.NullReferenceException occurs from DataGridRPTID.Model.GridVisualStyle.

What is problem??





SyncfusionGrid_error_93e4b166.zip

Jeraldes J [Syncfusion]
Replied On August 31, 2010 12:36 PM UTC

Hi,

You have to set this code in the Model.Initialized event in the grid. This is due to the datas to be initialized after that only the filter part will be set. If you try to do this before the data initialized, the styles will not be set.

This would solve you issue. If not could you please provide us with a sample to reproduce the issue.

Let us know if you need any other details.

Regards,
Jeraldes J

jungjin Park.
Replied On September 6, 2010 05:06 AM UTC

Hello,

I modified code the Model.Initialized in the grid.
I try to do this after the data initialized.
The after problem is solved.

Thank you.



Jeraldes J [Syncfusion]
Replied On September 7, 2010 04:02 AM UTC

Hi Park,

Thank you for you responce.

Let us know if you need any other details.

Regards,
Jeraldes J



CONFIRMATION

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.

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

;