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

[Solved] Grid ClientGroupHeaderTemplate Issue

4 Answers 223 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
khaldoun
Top achievements
Rank 1
khaldoun asked on 15 Jun 2011, 05:45 PM
Hi, I use GroupBy
The Problem is that I want to change ClientGroupHeaderTemplate 
columns.Bound(o => o.TypeOrder).ClientGroupHeaderTemplate("Order :<#= ProductTypeName #> ").Width(1);
And I have to Group it by TypeOrder, because TypeOder is an int so it sort it correctly but 
ProductTypeName is a string and it hasto be displayed.

@(Html.Telerik().Grid(Model.SelectionProducts)
            .Name("SelectedProducts").Columns(columns =>
            {
                columns.Bound(o => o.ProductTypeName).Title("Type").Width(100);
                columns.Bound(o => o.ProductName).Width(90).Title(Strings.Campaign_ProductName);
                columns.Bound(o => o.ProductPrice).Width(90).Title(Strings.Campaign_ProductPrice);
                columns.Bound(o => o.ProductId).Width(1).Title("");
                columns.Bound(o => o.ProductTypeId).Width(1).Title("");                
                columns.Bound(o => o.TypeOrder).ClientGroupHeaderTemplate("Order :<#= Key #> ").Width(1);
 
            }).PrefixUrlParameters(false).Scrollable().Groupable(grouping => grouping.Groups(group => group.Add(e => e.TypeOrder)).Visible(false))
                                                                    .Sortable(sorting => sorting.Enabled(false))
                                                                    .Footer(true).Selectable().ClientEvents(events =>
                                                                    {
                                                                        events.OnRowSelect("onRowSelectedRemoving");
                                                                        events.OnDataBound("onDataBoundSelected");
                                                                        events.OnLoad("OnLoad");
                                                                        events.OnDataBinding("onDataBinding");
                                                                    })
        .DataBinding(dataBinding => dataBinding.Ajax().Select("SelectionClientSide_SelectedProducts", "Campaign", new { area = "Retail", campaignId = Model.Id }))
 
 
                )
//HELP Please

4 Answers, 1 is accepted

Sort by
0
Stuart
Top achievements
Rank 1
answered on 19 Jul 2011, 01:16 PM
I  have the same requirement. Is this possible? if yes how? 
0
Atanas Korchev
Telerik team
answered on 19 Jul 2011, 02:59 PM
Hello Daniel,

 No the grid does not support that. The only properties exposed for the GroupHeaderTemplates are:
Title (the property to which column is bound to), Key (the value of the group) and any aggregates.

Regards,
Atanas Korchev
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Tomas
Top achievements
Rank 1
answered on 20 Feb 2012, 02:12 AM
Hi Atanas,

Is there any feature request or plans to support  this? As it makes Grouping functionality limited for this very common case.

Regards,
Tomas
0
Milos
Top achievements
Rank 1
answered on 14 Apr 2012, 02:47 PM
Why don't you create an auxiliary field in your view model that contains everything you need to show up in group header and group by that. You can get decent results, though this issue needs a bit of improvement.

Regards,
Tags
Grid
Asked by
khaldoun
Top achievements
Rank 1
Answers by
Stuart
Top achievements
Rank 1
Atanas Korchev
Telerik team
Tomas
Top achievements
Rank 1
Milos
Top achievements
Rank 1
Share this question
or