Hi,
I need to set values for footer and group summaries manually in a TcxGrid. I'm able to do it using a function you provided me a few months ago; I write it on the DataController's OnAfterSummary event to set my own values to both summaries footer and group, but the values at the groups header does not reflect my changes.
Note that I just want the same values to be displayed at header and footer of each group.
Could you help me? Thanks
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Bernardo,
To introduce this functionality you should handle the DataController's Summary.OnAfterSummary event in which you should populate values within the ASender.GroupSummaryValues array. In the attachment you will find a sample project demonstrating this approach. Please review it and inform me whether it meets your requirements.
I'm awaiting your response.
Thanks,
Stan.
Hi Stan,
Thank you for the sample project. It's very seemed to the procedure I was using before. Unfortunately, it also doesn't work.
I attached my code and a new image to this reply that I hope will help you discover this problem's cause.
So let me explain what I'm doing: I have 2 columns that link to different dataset fields but should show the second column summary values. So, I summarize both columns (using your grid's native tasks) and then overwrite the first column summary with the second column summary value. It works fine with group footer summary but not with group header summary that still shows grid's sum.
Image:
Please, compare columns named 'Custo Total' and 'Venda'
Thanks in advance
Hello Bernardo,
Thank you for the response. If I understand your task correctly it is not necessary to perform any custom calculation here. All you need is to adjust the first column's summaries so they will display summaries from the second column. This can be done as demonstrated in the attached sample.
Please try this solution and inform us of your results.
Thanks,
Stan.
Hi Stan,
The situation I explained in my last reply was just a way I found to clarify my question. I wanted you to know that even when I set the value for group summaries directly the summary that appears in group header does not reflects my changes.
I've attached another sample code (simplified) and another image to illustrate what I'm trying to explain. In my project some columns summaries values are calculations results based on previous summarized columns. So, I use the VENDA and CUSTO TOTAL columns summaries values in a function that returns values for column '%V->C' and so on… There is no field I can indicate to these default for groups columns - your last sample project is very useful for VENDA and CUSTO TOTAL columns, e.g., but it doesn't work with '%V->C' column that depends exclusively on calculations.
Maybe my function is not well constructed or there is a bug in cxGrid that prevents header groups summaries from being updated manually, so please take a careful look to the attached sample code. Hope you've understood my problem.
Best regards
Hello Bernardo,
Thank you for the sample code. I have researched it. The cause of the issue seems to be that you are not assigning a summary value for the summary item that is displayed within the group row. In your code, you are adjusting only a single summary item's value:
However, there should be another summary item whose Column property equals to the DadosMARGEMCUSTO column. You should find this summary item either by an index or by column, and adjust its value correspondingly.
Thanks,
Stan.
Hi Stan,
Thank you very much for your attention!
Let's see if I understood your explanation. I thought if I set a value to a GroupSummaryValues property providing a data group index and a column index I would be putting that value in group footer AND ALSO in group header; however, you are saying that I have to set group header values separately, right? Please correct me if I'm wrong…
If so, please send me a sample project because I don't know how to do that. What property should I use? How could I find the desired summary item (that's missing) by column?
Thanks
Hello Bernardo,
Yes, you are quite right. You should adjust summary values for group and footer summary items separately. You can obtain the necessary summary item using the GetDataItem method as demonstrated in the attached sample.
Please feel free to contact us if you need any additional assistance in this regard. We will be happy to help you.
Thanks,
Stan.
Hi Stan!
Thank you very much for help! It's working pretty fine now!
You are welcome, Bernardo!
Thanks,
Stan.