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, Thank you for the code-snippet you have provided. In order to calculate the sum of all Salary cells and all Bonus cells combined, an approach I can suggest you is to create a separate "Total" field, whose cells will be calculated and populated with the total sum for every record respectively using the XamCalculationManager. This way by creating a SummaryDefinition instance for the "Total" field as well, you should be able to get the total amount from the cells of the Salary and the Bonus fields. I have attached a sample application, where this approach has been used. If you require any further assistance on this matter, please do not hesitate to ask.
Brilliant Support!!! You have explained the concepts very clearly. Thanks a lot for that.
I still have one Question?
In this attached example , you have created Employee.cs class and some code snippet in MainWindow.xaml.cs file.
Is it possible to add the "data"[in this case employee data(Name,Salary,Bonus) directly in XAML code without adding Employee.cs class file and without writing anything new lines of code in MainWindow.xaml.cs file?
I don't know , I want to know is there a way to do that?
Please Help. Thanks in advance.
To put it in another way, I want the same application that you have given as an example, completely in XAML code, is that possible?
Hello Ganesh, You can always define an array or some other collection in XAML inside the Resources of the Window for example. This way by referencing the Employee class, you can create separate instances and populate the array. Afterwards by setting the DataSource of the XamDataGrid to the respective resource, you should be able to achieve an analogical functionality. The Employee class itself cannot be defined in xaml and you will need to use code-behind in this case. Another approach I can suggest you is to use an XML Data Binding. This will not require any C# code and the DataItem class can be defined in an XML file and directly bind a collection of it by using the XmlDataProvider. For more detailed information on implementing this approach, you can take a look at the "XamDataGrid>Data>XML Data Binding" sample in our Samples Browser.
I have modified and attached the sample from my previous reply with the first approach from above used in it. If you require any further assistance on the matter, please let me know.
Tacho, Thanks for your excellent support and help. You are a star!!!
Yes, I have already tried with XML data binding. It works fine.
Is there a way I can approach you directly in the future if want to know something in this forum?:-)