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

How to customize Members shown in PART_SimpleFilterMemberComboBox

3 Answers 25 Views
DataFilter
This is a migrated thread and some comments may be shown as answers.
Maurizio
Top achievements
Rank 2
Maurizio asked on 14 Aug 2014, 04:16 PM

We are using a RadDataFilter to let the user create simple filter expressions. How can we modify the Members shown in the combobbox PART_SimpleFilterMemberComboBox?

Assume we filter on a list of employees where the employee class has three properties ID, Name and Age and we only want Name and Age to appear in the
PART_SimpleFilterMemberComboBox?

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 15 Aug 2014, 11:08 AM
Hi,

You can achieve your goal, configuring the property you would like to not show with Browsable(false) attribute.
For example:
public class YourObject: INotifyPropertyChanged
{
    public event PropertyChangedEventHandler PropertyChanged;
 
    private string id;
 
    [Browsable(false)]
    public string ID
    {
        get { return this.id; }
        set
        {
            if (value != this.id)
            {
                this.id= value;
                this.OnPropertyChanged("ID");
            }
        }
    }
  ...
  }

Let me know how this works for you.

Regards,
Didie
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Maurizio
Top achievements
Rank 2
answered on 18 Aug 2014, 03:28 PM
Thank you Didie! [Browsable(false)] works fine for simple cases.

Meanwhile I have found myself a way to do more complex filtering: In the Initializied event of PART_SimpleFilterMemberComboBox I grab SimpleFilterViewModel.AvailableMembers which contains all browsable properties of the class I want to filter on.

Then I warp AvailableMembers into a CollectionView and set a Filter and SortDescriptions on this CollectionView.

The PART_SimpleFilterMemberComboBox.ItemsSource binds to this CollectionView.

So I can do any filtering I want and get a nicely ordered Combobox for the user to select the member he wants to filter on :)
  
0
Dimitrina
Telerik team
answered on 19 Aug 2014, 07:41 AM
Hello,

Indeed, this approach seems to be working fine. Thank you for sharing your solution.

Regards,
Didie
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
DataFilter
Asked by
Maurizio
Top achievements
Rank 2
Answers by
Dimitrina
Telerik team
Maurizio
Top achievements
Rank 2
Share this question
or