This is a migrated thread and some comments may be shown as answers.

CheckBox filter

3 Answers 192 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Li
Top achievements
Rank 1
Li asked on 11 Jan 2011, 05:00 PM
Hi,

I have a checkbox column and we want the filter showing something else when user clicking Filter instead of  (True, False). Is there a way to change the default? FilterDescriptor??

Thanks

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 11 Jan 2011, 05:33 PM
Hi,

 You can create your own custom filtering control. You can check this demo for more info:
http://demos.telerik.com/wpf/?GridView/CustomFilterControls

Regards,
Vlad
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Li
Top achievements
Rank 1
answered on 11 Jan 2011, 05:37 PM
I saw the demo but thought there might be something configable. I don't like to add a class just for the displaying.
0
Li
Top achievements
Rank 1
answered on 12 Jan 2011, 09:09 PM

I  modified the demo codes and I got the error message "Property'FilteringControl' does not support values of type 'myFilterControl' ". What does this mean?

 

 

public myFilterControl()

 

{

InitializeComponent();

}

 

public void Prepare(GridViewBoundColumnBase column)

 

{

 

this.column = column;

 

 

 

if (this.compositeFilter == null)

 

{

 

this.CreateFilters();

 

}

}

 

private void CreateFilters()

 

{

 

string dataMember = this.column.DataMemberBinding.Path.Path;

 

 

 

this.compositeFilter = new CompositeFilterDescriptor();

 

 

this.PlayedFilter = new Telerik.Windows.Data.FilterDescriptor(dataMember

 

, Telerik.Windows.Data.

FilterOperator.IsEqualTo

 

,

null);

 

 

 

this.compositeFilter.FilterDescriptors.Add(this.PlayedFilter);

 

}

 

private void OnFilter(object sender, RoutedEventArgs e)

 

{

 

//if (this.All.IsChecked == true)

 

 

 

 

 

 

//else

 

 

 

 

 

if (this.Played.IsChecked == true)

 

 

this.PlayedFilter.Value = true;

 

 

else if (this.NotPlayed.IsChecked == true)

 

 

this.PlayedFilter.Value = false;

 

 

if (!this.column.DataControl.FilterDescriptors.Contains(this.compositeFilter))

 

{

 

this.column.DataControl.FilterDescriptors.Add(this.compositeFilter);

 

}

 

 

this.IsActive = true;

 

}

Tags
GridView
Asked by
Li
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Li
Top achievements
Rank 1
Share this question
or