Custom totals/rows on summary

23 posts, 0 answers
  1. Antonio Ibáñez Oliva
    Antonio Ibáñez Oliva avatar
    13 posts
    Member since:
    Aug 2012

    Posted 13 Jun 2012 Link to this post

    Hi,
     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
  2. Smith
    Smith avatar
    8 posts
    Member since:
    Jun 2012

    Posted 14 Jun 2012 Link to this post

    you may put a string as format. It will show your string instead of the format.

    i.e.
    GridViewSummaryItem item1 = new GridViewSummaryItem("column1", "sub total", GridAggregateFunction.Sum);
  3. Antonio Ibáñez Oliva
    Antonio Ibáñez Oliva avatar
    13 posts
    Member since:
    Aug 2012

    Posted 15 Jun 2012 Link to this post

    Hi, the problem is that i don't want to use aggregation options. If i put a second summary row, it doesn't appear and my view definition (columns groups) disappears too.

    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.
  4. Smith
    Smith avatar
    8 posts
    Member since:
    Jun 2012

    Posted 15 Jun 2012 Link to this post

    Hi Antonio,

    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);
  5. Ivan Petrov
    Admin
    Ivan Petrov avatar
    717 posts

    Posted 18 Jun 2012 Link to this post

    Hi Guys,

    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
    RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
  6. Antonio Ibáñez Oliva
    Antonio Ibáñez Oliva avatar
    13 posts
    Member since:
    Aug 2012

    Posted 18 Jun 2012 Link to this post

    Hi Ivan
    Thank you!! It works flawlessly.
  7. jamsheer
    jamsheer avatar
    64 posts
    Member since:
    Feb 2017

    Posted 21 Apr 2017 Link to this post

    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

  8. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3903 posts

    Posted 21 Apr 2017 Link to this post

    Hello 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
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  9. jamsheer
    jamsheer avatar
    64 posts
    Member since:
    Feb 2017

    Posted 22 Apr 2017 Link to this post

    Hi Ivan,
        
    Thanks 
    Jamsheer
  10. jamsheer
    jamsheer avatar
    64 posts
    Member since:
    Feb 2017

    Posted 22 Apr 2017 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    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

  11. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3903 posts

    Posted 24 Apr 2017 Link to this post

    Hello 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
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  12. jamsheer
    jamsheer avatar
    64 posts
    Member since:
    Feb 2017

    Posted 24 Apr 2017 Link to this post

    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

  13. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3903 posts

    Posted 24 Apr 2017 Link to this post

    Hello 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
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  14. jamsheer
    jamsheer avatar
    64 posts
    Member since:
    Feb 2017

    Posted 24 Apr 2017 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    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

  15. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3903 posts

    Posted 24 Apr 2017 Link to this post

    Hello 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
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  16. jamsheer
    jamsheer avatar
    64 posts
    Member since:
    Feb 2017

    Posted 25 Apr 2017 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    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

  17. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3903 posts

    Posted 25 Apr 2017 Link to this post

    Hello 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
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  18. jamsheer
    jamsheer avatar
    64 posts
    Member since:
    Feb 2017

    Posted 25 Apr 2017 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hi Dess,
          Its works successfully . 
    Thanks 
    Jamsheer
  19. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 23 Jul in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hello Dess ... 

    How Are U ? 

    long time no see 

    Can I ask about fill textbox from summaryrow and hidden the summaryrow

     

    Tq

  20. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3903 posts

    Posted 23 Jul Link to this post

    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

  21. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 24 Jul in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hai Dess 

    I just need to parsing the value of summarygridrow to textbox 

    hope u understand.

     

    tq

  22. Hengky
    Hengky avatar
    60 posts
    Member since:
    Sep 2015

    Posted 24 Jul in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hai Dess 
    I just need to parsing the value of summarygridrow to textbox 
    hope u understand.

    tq
  23. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3903 posts

    Posted 24 Jul Link to this post

    Hello, Hengky, 

    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

Back to Top