I would like to know how to get the column summary in XAML code. I'm able to get the row summaries using the code mentioned in attachment or image.
But I do not know how to add contents from "Salary" and "Bonus" to get the TotalAmount in XAML code only without using code-behind . I'm using xamDataGrid.
Hello Ganesh, The new thread you have created has already been replied.
In order to separate the issues and provide you with a better support in regards to the issues' specific context, we will continue updating you on the matter at the specified thread.
You can guide me on this. I can ready to delete that post which is on another thread.
Else please give one simple example so that I can get some idea.
Hello Ganesh, It seems that the question you are having is the same as the one that you are having at the following thread. In order to distinct the issues and keep track of them more easily, you will continue getting updates on the matter at the specified thread.
Hi Tacho,
Below code works fine. I haven't written any c# code. This program works fine as well. But I would like to know how to convert this to a ViewModel class so that I can dynamically add fields and select whenever is required.
<Window x:Class="XAMLTask4.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ig="http://schemas.infragistics.com/xaml" xmlns:igDP="http://infragistics.com/DataPresenter" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:igEditors="http://infragistics.com/Editors" Title="MainWindow" Height="350" Width="525">
<Window.Resources> <XmlDataProvider Source="Employeedetails.xml" x:Key="EmployeedetailsData" XPath="/Employee"/> </Window.Resources> <Grid> <StackPanel> <ig:XamCalculationManager x:Name="CalculationManager" />
<ig:XamFormulaEditor Margin="5" Target="{Binding ElementName=DataGrid, Path=FieldLayouts[0].Fields[totalSalary]}"/> <ig:XamFormulaEditor Margin="5" Target="{Binding ElementName=DataGrid, Path=FieldLayouts[0].Fields[nameAndLoc]}"/>
<igDP:XamDataGrid x:Name="DataGrid" Theme="IGTheme" ig:XamCalculationManager.CalculationManager="{Binding ElementName=CalculationManager}" DataSource="{Binding Source={StaticResource EmployeedetailsData},XPath=efield}">
<igDP:XamDataGrid.FieldSettings> <igDP:FieldSettings AllowSummaries="true" SummaryUIType="MultiSelect" SummaryDisplayArea="BottomFixed"/> </igDP:XamDataGrid.FieldSettings> <igDP:XamDataGrid.CalculationAdapter> <igDP:DataPresenterCalculationAdapter ReferenceId="dataPresenterAdapter"/> </igDP:XamDataGrid.CalculationAdapter> <igDP:XamDataGrid.FieldLayoutSettings> <igDP:FieldLayoutSettings AutoGenerateFields="False"/> </igDP:XamDataGrid.FieldLayoutSettings> <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout CalculationReferenceId="Employeedetails">
<igDP:FieldLayout.Fields> <igDP:Field Name="name" Label="Employee Name"/> <igDP:Field Name="location" Label="Location"/>
<igDP:Field Name="nameAndLoc" Label="Name and Location" BindingType="Unbound"> <igDP:Field.CalculationSettings> <igDP:FieldCalculationSettings Formula="CONCATENATE([name],[location])" ReferenceId="namelocref" /> </igDP:Field.CalculationSettings> </igDP:Field> <!--<igDP:Field Name="email" Label="Email" />--> <igDP:Field Name="salary" Label="Salary" /> <!--<igDP:Field Name="bonus" Label="Bonus" />--> <!-- Unbound Currency Fields displaying calculated values --> <igDP:UnboundField Name="bonus" Label="Bonus" > <igDP:UnboundField.CalculationSettings> <igDP:FieldCalculationSettings Formula="[salary]*10/100" ReferenceId="bonusref" /> </igDP:UnboundField.CalculationSettings> </igDP:UnboundField>
<igDP:UnboundField Name="totalSalary" Label="Summary" > <igDP:UnboundField.CalculationSettings> <igDP:FieldCalculationSettings Formula="([salary]+[bonus])" ReferenceId="totalsalref" /> </igDP:UnboundField.CalculationSettings> </igDP:UnboundField>
</igDP:FieldLayout.Fields>
<igDP:FieldLayout.SummaryDefinitions> <igDP:SummaryDefinition Key="Salary" SourceFieldName="salary" Calculator="Sum" StringFormat="{}{0:C}" /> <igDP:SummaryDefinition Key="Bonus" SourceFieldName="bonus" Calculator="Sum" StringFormat="{}{0:C}" /> <igDP:SummaryDefinition Key="Total" SourceFieldName="totalSalary" Calculator="Sum" StringFormat="{}{0:C}" /> </igDP:FieldLayout.SummaryDefinitions>
</igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid>
</StackPanel> </Grid></Window>
XML file:
<?xml version="1.0" encoding="utf-8" ?><Employee> <efield name="ganesh"> <location>Bangalore</location> <salary>1000</salary> <!--<bonus>100</bonus>--> </efield>
<efield name="prasad"> <salary>2000</salary> <location>Mangalore</location> <!--<bonus>100</bonus>--> </efield>
<efield name="steve"> <salary>3000</salary> <location>Mysore</location> <!--<bonus>100</bonus>--> </efield>
<!--<efield name="a"> <salary>3000</salary> --><!--<bonus>100</bonus>--><!-- </efield>
<efield name="r"> <salary>3000</salary> --><!--<bonus>100</bonus>--><!-- </efield>-->
</Employee>
Hello Ganesh, Thank you for your feedback. I am glad to know that I was able to help you achieve the functionality you were looking for. I believe this thread can help other people looking for a similar solution. We do not support specific team member communication with the customers. All Infragistics representatives strive forward to providing the best support service possible and we are always ready to assist you. If you require any further assistance on this matter, please let me know.