Master Detail Hierarchy

Hoping someone can give me a solution to this. I have created a Master Detail Hierarchy Page from the templates. I am filtering the child data based on a date range (first of month to last of month) and I want to sum the columns in the detail grid to corresponding columns in the master grid. I would like to do this onload. I have tried foreach loops as this is the only way I can see to do it and have had no luck.

Master Table = Agents
Columns = Agent (primary key), Calls, Emails, Text
Detail Table = DailyContacts
Columns = Date, Agent (foreign key), Calls, Emails, Text

For each row in Agents
sum Calls, Emails, Text with date range of first of month to last of month
store sums to Calls, Emails, Text in Agents

Any help with this would be appreciated. I know I need to execute some C# which is outside of the Radzen purview, but I haven't been able to find a good tutorial or example and just keep fumbling with it.

Thank you in advance. (And if you can't help me, I still love Radzen!!!)

Hello,
You will need to extend the agents table as shown here and add required column totals as extended agents table property and use these columns in your master grid
also note I think it is easier to implement as footer totals of your DailyContacts in child grid as shown here if that serves your purpose :slight_smile:

Thank you. I have used your example for extending tables and it works very well. In this situation, I only want to display the Agent Grid with the summed values of the Agent Detail (Calls, Emails, Text) and not show the Agent Detail at all. The closest I have gotten is to use the Master/Detail Hierarchy template, but I have not been able to "Sum Up" the Agent Detail columns and store those values in the Agent.
Here is a representation of what I am looking to do. I have tried to use foreach, but I can't seem to get it right.

and this is the result I am trying to accomplish

If someone can point me in the right direction I would appreciate it.

Your reply got me thinking (sometimes not getting the desired answer is the best answer of all!). I was approaching this all wrong. I simply needed to create a view and then filter it in the datagrid! I am learning something new every day. Thank you for all your help!!!