Setting filters/rows etc in code

7 posts, 0 answers
  1. Glen
    Glen avatar
    17 posts
    Member since:
    Aug 2010

    Posted 29 Oct 2013 Link to this post

    Hi, do you have a code example that shows how to set a filter, row, column etc in code?  I have implemented the serializer for storing the entire state but would like to manually set up certain filters on the query. 
  2. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 29 Oct 2013 Link to this post

    Hi Glen,

    In our Populating with Data articles you will find out how to set different descriptions for the respective DataProvider with three languages - XAML, C# and Visual Basic. You can take a look at them here:
     - LocalDataSourceProvider
     - XmlaDataProvider

    Hopefully this helps. Feel free to contact us in case you have any problems or concerns.

    Regards,
    Rosen Vladimirov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    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 >>
  3. DevCraft banner
  4. Glen
    Glen avatar
    17 posts
    Member since:
    Aug 2010

    Posted 29 Oct 2013 Link to this post

    Hi, thanks, I've got it working :) Is there any way to add filters but hide them from the UI so that users cannot remove them?
  5. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 30 Oct 2013 Link to this post

    Hello Glen,

    Do you mean that you want to hide them from RadPivotFieldList? If you are using only RadPivotGrid (without RadPivotFieldList) the users will not be able to remove any filters, group descriptions or aggregates.

    Could you clarify what is the scenario that you want to achieve?

    Regards,
    Rosen Vladimirov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    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 >>
  6. Glen
    Glen avatar
    17 posts
    Member since:
    Aug 2010

    Posted 30 Oct 2013 Link to this post

    Actually I just realised my filter isn't being applied correctly.  The filter is displaying in the field list however the items aren't checked correctly.  In the VS output window I am seeing

    System.Windows.Data Error: BindingExpression path error: 'IsSelected' property not found on 'Telerik.Windows.Controls.FieldList.Editing.ItemsSetFilterViewModel' 'Telerik.Windows.Controls.FieldList.Editing.ItemsSetFilterViewModel' (HashCode=46719429). BindingExpression: Path='IsSelected' DataItem='Telerik.Windows.Controls.FieldList.Editing.ItemsSetFilterViewModel' (HashCode=46719429); target element is 'System.Windows.Controls.CheckBox' (Name=''); target property is 'IsChecked' (type 'System.Nullable`1[System.Boolean]')

     

     

    XmlaFilterDescription topFilterDescription = new XmlaFilterDescription();
              topFilterDescription.MemberName = "[Book].[Book Code]";
     
              OlapSetCondition condition1 = new OlapSetCondition();
              condition1.Comparison = SetComparison.Includes;
              condition1.Items.Add("[Book].[Book Code].&[AAAA400]");
     
              XmlaLevelFilterDescription levelFilterDescription1 = new XmlaLevelFilterDescription();
              levelFilterDescription1.MemberName = "[Book].[Book Code]";
              levelFilterDescription1.Condition = condition1;
              topFilterDescription.Levels.Add(levelFilterDescription1);
     
              dp.FilterDescriptions.Add(topFilterDescription);

     

     

     

  7. Rosen Vladimirov
    Admin
    Rosen Vladimirov avatar
    640 posts

    Posted 04 Nov 2013 Link to this post

    Hi Glen,

    When you use Hierarchical filters you cannot specify a filter for the top-level item as in most of the cases this item just marks the full hierarchy. Also the Member Name must point to the unique name of each member in the hierarchy. In your case the topFilterDescription and levelFilterDescription1 have the same Member name, which is not allowed. I've prepared a sample project for you to demonstrate how to handle hierarchies and filters via RadPivotGrid. Please give it a try and inform us in case you have any problems or concerns.

    Regards,
    Rosen Vladimirov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    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 >>
  8. Glen
    Glen avatar
    17 posts
    Member since:
    Aug 2010

    Posted 07 Nov 2013 Link to this post

    Thanks, it's working now
Back to Top
DevCraft banner