I would like to add custom values (string) to summary rows, without using aggregation formulas. Is it possible? I want something like the attached image.
Thanks
22 Answers, 1 is accepted
i.e.
GridViewSummaryItem item1 = new GridViewSummaryItem("column1", "sub total", GridAggregateFunction.Sum);
And i don't know if it is correct to mix aggregation items with non aggretation items on the same column. I have done this:
For the first summary row, SUBTOTAL, i have used the sum aggregation function. then i have added a second summary row, added items with aggregation option to none but it doesn't work.
sorry if I get it all wrong. I assume that you want to use more than 1 aggregation function in one radgridview and it seem you maybe want to use aggregation function and then display your data and then use aggregation function to display grand subtotal again.
as far as I knew, In this case you may work around by use the aggregation function to display string from a string builder on second line and then use manual aggregation function to display total on third line. However, the aggregation function on third line need to calculate behind the scene manually. I think this is not the good answer yet >_<
like this
//summaryrow1
GridViewSummaryItem item1 = new GridViewSummaryItem("column1", "Gross Profit Before Tax", GridAggregateFunction.Sum);
//sb is string builder that concatenate string from other variable.
//summaryrow2
GridViewSummaryItem item1 = new GridViewSummaryItem("column1","Tax", GridAggregateFunction.Sum);
GridViewSummaryItem item2 = new GridViewSummaryItem("column2", sb1.tostring(), GridAggregateFunction.Sum);
//summaryrow3
GridViewSummaryItem item1 = new GridViewSummaryItem("column1", "Gross Profit After Tax", GridAggregateFunction.Sum);
Thank you both for writing.
Please, find attached a sample project which demonstrates how to achieve this scenario with RadGridView. The example uses the build-in AggregateExpression mechanism to accomplish the calculations needed for the second and third (top-to-bottom) summary row values.
I hope this will be useful. Should you have further questions, I would be glad to help.
All the best,
Ivan Petrov
the Telerik team
Thank you!! It works flawlessly.
Hi Ivan,
I have a Radgrid with summery row, where debit and credit has values ,I want to get 'Debit-Credit' at each summery rows.
In the below pic i want to get like (A-B) to 'Balance' of summeryrow of grid.
Thanks
Jamsheer
Thank you for writing.
You can add a custom GridViewSummaryItem for a specific column and control how the calculation is done by overriding the Evaluate method. Additional information is available here: http://testdocs.telerik.com/devtools/winforms/gridview/rows/summary-rows
Alternatively, you can use a calculated column where the expression will be credit - debit. Thus, the summary item for this column will have the desired result.
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Telerik by Progress
Thanks
Jamsheer
Hi Ivan,
Its works successfully with new column, But here I cant create new column,because the answer should become at 'Balance' cells of each SummeryRow of RadGrid
Where I want 'Credit- Debit' of SummeryRow to string variable ,or I want to fill (Credit-Debit) to 'Balance' cells of each SummeryRow of RadGrid
Below pic (A-B) to one variable ,or (A-B) to 'Balance' Cells of SummeryRow of RadGrid
Thanks
Jamsheer
Thank you for writing back.
If you add a calculated column with expression "A-B" the summary row will have the desired value. However, if the "Balance" column contains values which summary needs to display the "A-B" where A and B are values from another column, it is suitable to use a custom GridViewSummaryItem and perform the custom calculation. I have attached a sample project which result is illustrated in the attached screenshot.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik by Progress
Hi Dess,
Here I am using a RadCheckedDropDownList for multi select value. Where I want all checked values of RadCheckedDropDownList to the datatable.
Please Refer how could I add to the datatable the checked values from the checked list of RadCheckedDropDownList.
I need Like this : ' if(Checkeddrpdwnlist1.checked==true) ' then the value to datatable.
Thanks
Jamsheer
Thank you for writing back.
I would like to note that this forum thread is related to RadGridView. I would kindly ask you to open a new thread with the appropriate Product (e.g. RadCheckedDropDownList for WinForms) and to avoid mixing different subjects in the same thread in future. This will also give you the opportunity to track the different cases easily. Thank you for your understanding.
If you have any additional questions regarding RadGridView in this thread, please let me know.
Regards,
Dess
Telerik by Progress
Hi Dess,
Sorry for the above question,
Its working good, but getting error at the end part i think its because of my Grid has Group function.
where my grid is grouped by Names. The error getting at the end row of total sum .
please Refer an example Grouped Grid .
Thanks
Jamsheer
Thank you for writing back.
Following the provided information, I was unable to reproduce the issue you are facing with the latest version. I have attached my sample project. Could you please specify the exact steps how to reproduce the problem so I can investigate the precise case? Thank you in advance.
I am looking forward to your reply.
Regards,
Dess
Telerik by Progress
Hi Dess,
Sorry, Hope you didn't get my problem.
where my showtotal property is true here (this.DgvTrialBalance.MasterTemplate.ShowTotals = true;) , That's because i have one more additional row for getting the total of all group .
I didn't get balance at the showtotal row , Please refer how it can possible.
I briefly explained at the picture below.
Thanks
Jamsheer
Thank you for writing back.
Please refer to the modified project which demonstrates a sample approach how to iterate the child rows for the groups at the master level and calculate the balance. The attached screenshot illustrates the result on my end. Note that this is just a sample approach and it may not cover all possible cases. Feel free to modify it in a way which suits your requirement best.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik by Progress
Its works successfully .
Thanks
Jamsheer
Hello Dess ...
How Are U ?
long time no see
Can I ask about fill textbox from summaryrow and hidden the summaryrow
Tq
Hi, Hengky,
According to the provided brief information it wouldn't be easy to understand the complete requirement that you have. Could you please give us some more details about the goal that you are trying to achieve? Once we get better understanding of the required functionality, we would be able to think about a suitable solution and provide further assistance.
Thank you in advance. I am looking forward to your reply.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Hai Dess
I just need to parsing the value of summarygridrow to textbox
hope u understand.
tq
I just need to parsing the value of summarygridrow to textbox
hope u understand.
tq
If I understand your requirement correctly, you need to extract the summary value and assign it to a text box.
The following forum post shows a sample approach how you can iterate the GridViewSummaryItems contained in a GridViewSummaryRowInfo and get the value of each item: https://www.telerik.com/forums/to-get-summary-row-values-in-to-variable#6GX04NjH9EW0Lu-ZFjvyqA
I hope this information helps.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik