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

[Solved] Grouping by Column Template

1 Answer 25 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.
Scott
Top achievements
Rank 1
Scott asked on 17 Apr 2012, 03:18 PM
I am using the MVC Extensions Grid and have an embedded Grid which uses a combination of bound columns and template columns.  Is it possible to group by a template column, if so how?  The following code produces an error: "memberName" cannot be null or empty.

Html.Telerik().Grid(Model.GetPrivileges(item.SSGOid.Value, item.SSGApplicationID))
                    .Name("TopicPrivileges")
                    .Columns(columns =>
                    {
                        columns.Bound(o => o.IsEnabled).Width(75).Title("Enable");
                        columns.Template(o => o.GetTopicDisplayName(Model, item.SSGApplicationID)).Width(200);
                        columns.Template(o => o.GetParentTopic(Model, item.SSGApplicationID)).Width(200).Title("Home Topic");
                        columns.Bound(o => o.ActionId).Width(150);
                         
                    })
                            .Groupable(grouping => grouping.Groups(groups =>
                            {
                                groups.Add(o => o.GetParentTopic(Model, item.SSGApplicationID));
                            }))
                    .Pageable()
                    .Sortable()
                    .Filterable()


Thanks for any help.

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 18 Apr 2012, 02:19 PM
Hi Scott,

Grouping/Paging/Filtering on template columns is not supported. You can bind your column to a model property and set its template instead - this way the paging/grouping will be applied according to the value of the binding property.

Kind Regards,
Petur Subev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Grid
Asked by
Scott
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or