datagrid advanced filters & summaries setup from code behind

Posted by: philteare on 7 August 2017, 8:33 am EST

  • Posted 7 August 2017, 8:33 am EST

    Hello,

    normally when I use a c1datagrid I'll add this xaml for the advanced behaviour:

    <c1:C1GroupingWithSummariesBehavior.GroupingWithSummariesBehavior>
    <c1:C1GroupingWithSummariesBehavior />
    </c1:C1GroupingWithSummariesBehavior.GroupingWithSummariesBehavior>
    <c1:C1AdvancedFiltersBehavior.AdvancedFiltersBehavior>
    <c1:C1AdvancedFiltersBehavior />
    </c1:C1AdvancedFiltersBehavior.AdvancedFiltersBehavior>

    Is it possible to do this from the code behind instead?

    thanks!

    Phil.
  • Replied 7 August 2017, 8:33 am EST

    Sorry, missed the code there.

                                <c1:C1GroupingWithSummariesBehavior.GroupingWithSummariesBehavior>
    <c1:C1GroupingWithSummariesBehavior />
    </c1:C1GroupingWithSummariesBehavior.GroupingWithSummariesBehavior>
    <c1:C1AdvancedFiltersBehavior.AdvancedFiltersBehavior>
    <c1:C1AdvancedFiltersBehavior />
    </c1:C1AdvancedFiltersBehavior.AdvancedFiltersBehavior>
  • Replied 7 August 2017, 8:33 am EST

    Yes, you can set enable both features using code. See below code:-

     C1GroupingWithSummariesBehavior.SetGroupingWithSummariesBehavior(grid, new C1GroupingWithSummariesBehavior());
    C1AdvancedFiltersBehavior.SetAdvancedFiltersBehavior(grid, new C1AdvancedFiltersBehavior());


    Regards
  • Replied 8 September 2018, 5:53 pm EST

    can we use the built-in C1AdvancedFiltersBehavior with datagridtemplatecolumns?
    OR use some kind of built-in header templates to get this filtering ?
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels