This is a migrated thread and some comments may be shown as answers.

Merging cells in a footer aggregate

8 Answers 183 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Iulian Ilies
Top achievements
Rank 1
Iulian Ilies asked on 23 Apr 2010, 09:22 PM
Hi there,

I would like to merge some of the cells in a footer aggregate

You should make an idea by looking at the following table

Item

Quantity

Price

Value

Item A

2

10

20

Item B

3

12

36

Total Value (long footer label):

56


The [Value] column has the actual aggregate footer, while the label for it will span accross Quatity & Price footer.

Is it possible out of the box? Can you suggest any solution?

Thanks in advance
Iulian

8 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 26 Apr 2010, 02:26 PM
Hi Iulian Ilies,

In order to achieve the desired state of the cell of the footer, you need to predefine its style, as for the time being there is no other out-of-the-box solution. You should adjust the values of the "Margin" and "Border" Properties of the Footer Cell in order to fit appropriately in the Grid. Afterwards, you need to set the Property of the Column "FooterCellStyle" to the Style you have predefined. I am attaching you a sample project where you can see and test the proposed solution.

 
Regards,
Maya
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Iulian Ilies
Top achievements
Rank 1
answered on 29 Apr 2010, 08:05 PM
Hi Maya,

Thanks for your replay. I was away from this issue for a few days and I could not try your solution.

Unfortunetely it's not what I wanted; I am not sure if I was clear enough.
In your very same sample you posted it, I just increase the length of the caption of the aggregate function ("Position" column) and the column size increased too. (please see the attached pic)

What I understand from your idea is you just play around with the style of those to columns footer ("Number" & "Position") so they won't have a separator but this is not what I want.
What I would like is a real merge functionality, so the caption will spread across of something like a common footer for the 2 columns mentioned above.

Any other thought?

Thanks
Iulian
0
Maya
Telerik team
answered on 30 Apr 2010, 02:58 PM
Hello Iulian Ilies,

The proposed solution implements a custom behavior closest to the functionality you want for your project. Unfortunately, for the time being there is no straightforward way to achieve merging of cells of the aggregate results in the footer.

Sincerely yours,
Maya
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Carlos
Top achievements
Rank 1
answered on 23 Nov 2015, 07:49 PM
it's possible now?
0
Maya
Telerik team
answered on 24 Nov 2015, 09:12 AM
Hi Carlos,

We have received very few requests about such functionality and currently it has not yet been implemented as we are working on features with higher priority. For the time being, the suggested solution here is the way to go. 

Regards,
Maya
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Saif Akhtar
Top achievements
Rank 1
answered on 02 Aug 2017, 07:30 AM

Hi Maya,

Is it available now?

0
Sia
Telerik team
answered on 04 Aug 2017, 10:01 AM
Hello,

We do not provide out-of-the-box support for this feature currently. You can follow the public item about merged footer cells and like it to increase its priority in our future plannings. Also adding any information about the exact scenario will also be of great value for our team.

Regards,
Sia
Progress Telerik
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.
0
R. J.
Top achievements
Rank 1
answered on 02 Feb 2018, 01:27 PM

Iulian -

Old, I know, but I just had the same issue.  The difference is, I wanted to merge all cells up to a single, aggregate row.  From what I've done, you or others may extrapolate the below to get the footer to do what you wish it to.  Hope this helps some:

 

01.var numColumnsBeforeDesiredColumn = 0,
02.    $grid = $("#grid");
03. 
04.$grid.thead.find("th").each(function (index) {
05.    if ($(this).attr("data-field") === "QuantityToReceive") {
06.        numColumnsBeforeDesiredColumn = index;
07.        return false;
08.    }
09.});
10. 
11.if (numColumnsBeforeDesiredColumn > 0) {
12.    $grid.footer.find("td:first").html("<em>Total magazines to send out:</em>").css({ textAlign: "right", paddingRight: "1rem" });
13. 
14.    var numVisibleBeforeDesiredColumn = 0;
15. 
16.    $grid.footer.find("td").each(function (index) {
17.        var $el = $(this);
18. 
19.        if ($el.is(":visible")) {
20.            numVisibleBeforeDesiredColumn++;
21. 
22.            if (index > 0 && index < numColumnsBeforeDesiredColumn) {
23.                $(this).css("display", "none");
24.            }
25.        }
26.    });
27. 
28.    $grid.footer.find("td:first").attr("colspan", numVisibleBeforeDesiredColumn - 1);
29.}
Tags
GridView
Asked by
Iulian Ilies
Top achievements
Rank 1
Answers by
Maya
Telerik team
Iulian Ilies
Top achievements
Rank 1
Carlos
Top achievements
Rank 1
Saif Akhtar
Top achievements
Rank 1
Sia
Telerik team
R. J.
Top achievements
Rank 1
Share this question
or