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

[Solved] load saved filter

1 Answer 122 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Berthold
Top achievements
Rank 1
Berthold asked on 16 Dec 2010, 12:55 PM
Hi,

we are working with server side filtering (as described in another article).
Worked well.

We also save and load the filters in a database, which works, too.
The only thing is: the yellow sign in the header will not update correctly.
That's because I add a Eventhandler in the prepare Function of the custom filte:

public void Prepare(GridViewBoundColumnBase column)
{
 if (this._domainModelFilter == null)
 {
  if (_domainModelFilter == null)
   return;
  _domainModelFilter.PropertyChanged += new PropertyChangedEventHandler(FilterPropertyChanged);

 ...
 }
}

In the FilterPropertyChanged-Method the Customfilter will be updated.
Unfortunately the "Prepare-method" is called, when the user clicks the first time on the filter symbol. When we load the filters before any customfilter ist poped up, no filter-sign will be updated.

How can I update this sign without opening the custom filter dialog?

Thanks
Berthold

1 Answer, 1 is accepted

Sort by
0
Rossen Hristov
Telerik team
answered on 17 Dec 2010, 12:15 PM
Hello Berthold,

You can programmatically do this by manually setting the IsActive property of your FilteringControl instance to true. Since the UI is bound to this property, the funnel will light up. In this way, you will not have to wait for the Prepare method to be called.

Then, the first time PropertyChanged event is fired you can establish a real Binding between the IsActive property and the property on your view model that determines whether the filtering control is active or not. Like in the blog post, which I assume you have read since you have created your own filtering control.

Let me know if there are problems.

Kind regards,
Ross
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
Tags
GridView
Asked by
Berthold
Top achievements
Rank 1
Answers by
Rossen Hristov
Telerik team
Share this question
or