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

UI problem with custom filtering and inherited filter

3 Answers 79 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Patrick asked on 01 Nov 2013, 08:55 AM
Hello,
I'm defining custom filters that inherits from existing filters. In Silverlight, I have no problem with this, but in WPF, the custom filters doesn't show all the options the first time it is displayed.

For example, if I define my custom filter as:
Namespace OrdinaSoft.Windows.Controls;
 
Interface
 
  Uses
    System.Windows,
 
    Telerik.Windows.Controls,
    Telerik.Windows.Controls.GridView,
    Telerik.Windows.Data;
 
  Type
    FilteringControl Nested In osRadGridViewTextColumn = Private Sealed Class (
      Telerik.Windows.Controls.GridView.FilteringControl
    )
 
    Public
 
      Constructor;
 
      Method Prepare (Column : GridViewColumn); Override;
 
    End;
 
Implementation
 
  Constructor osRadGridViewTextColumn.FilteringControl;
  Begin
    Style := System.Windows.Style (Application.Current.Resources ['FilteringControlStyle'])
  End;
 
  Method osRadGridViewTextColumn.FilteringControl.Prepare (
    Column : GridViewColumn
  );
  Begin
    Inherited Prepare (Column);
  End;
 
 
End.

Actually, this filter does nothing, it just inherits from the Telerik one.
Now, when I click on the funnel, the first time, the filter only displays the combo boxes, as you can see in the enclosed screen shot.
The second time the filter is displayed, it contains all the items.

Patrick

3 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 06 Nov 2013, 02:04 PM
Hi Patrick,

You need to ensure that your filtering control has a constructor that accepts the column of the filtering control and calls the base constructor with this parameter:

public MyFilteringControl(Telerik.Windows.Controls.GridViewColumn column)
   : base(column)
   {        
 
   }

And then create it by telling it which column it is designed for.

This will link the column and the filtering control from the very beginning and everything should work as though you were using the stock filtering control.


Regards,

Yoan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
answered on 06 Nov 2013, 03:09 PM
Hello Yoan,
thanks for the solution: it is working fine now!
But it should be interesting to update the documentation to have this information for other users.
Patrick
0
Yoan
Telerik team
answered on 11 Nov 2013, 02:31 PM
Hello Patrick,

Thank you for the remark about our documentation. We will update it with that additional information.

Regards,
Yoan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Yoan
Telerik team
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or