Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1890
Dynamanically Add Summary Definitions
posted

I have a custom control of a type xamdatagrid. I created a SummaryCalculator that I would like to attach to the custom control. How do I set the following in code:

 

<igDP:SummaryDefinition DisplayArea="BottomFixed" SourceFieldName="checkbox" Calculator="{markup:SelectedRecordsCalculatorMarkup}"/>

 

Or how can I create it in a style page and attach it to the custom control?

Also is there a way when using SummaryDefinitons.Add() to pass a field column index instead of a field column name?

Parents
  • 1890
    Verified Answer
    posted

    Nevermind I figured it out by doing the following:

    SelectedRecordsCalculator mySelectedCount = new SelectedRecordsCalculator();
    SummaryCalculator.Register(mySelectedCount);
    SummaryDefinition mySelectedCountDefinition = new SummaryDefinition();
    mySelectedCountDefinition.SourceFieldName="name";           
    mySelectedCountDefinition.Calculator = mySelectedCount;          
    xamDataGrid1.FieldLayouts[0].SummaryDefinitions.Add(mySelectedCountDefinition);

     

Reply Children