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?
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);
I would still like to know is there a way I can set a fieldname by index instead of name. I don't like to do something like below because I won't know what the name is:
mySelectedCountDefinition.SourceFieldName="name";