This question is locked. New answers and comments are not allowed.
Hello,
I have used Asp.net MVC Grid and have grouped on a column(subject) and used groupheadertemplate to display count of rows.
I want to add custom data from model to the count in header.
How can I do that?
following is the code that I use:
@(Html.Telerik().Grid(Model)
.Name("Grid1")
.Columns(columns =>
{
columns.Bound(o => o.Type).Filterable(false).Title("Type");
columns.Bound(o => o.ReceiveDate).Title("Date");
columns.Bound(o => o.Subject).Title("Subject")
.Aggregate(c => c.Count()).
GroupHeaderTemplate(@<text>@item.Title: @item.Key (@item.Count)</text>);
columns.Bound(o => o.Comments).Title("Comments");
}).Groupable(grouping => grouping.Groups(groups =>
{
groups.Add(c => c.Subject);
}))
)
I want something like this:
@(Html.Telerik().Grid(Model)
.Name("Grid1")
.Columns(columns =>
{
columns.Bound(o => o.Type).Filterable(false).Title("Type");
columns.Bound(o => o.ReceiveDate).Title("Date");
columns.Bound(o => o.Subject).Title("Subject")
.Aggregate(c => c.Count()).
GroupHeaderTemplate(@<text>@item.Title: @item.Key (@item.Count + Convert.ToInt32(Model.MyCount))</text>);
columns.Bound(o => o.Comments).Title("Comments");
}).Groupable(grouping => grouping.Groups(groups =>
{
groups.Add(c => c.Subject);
}))
)
Is this possible?
Thanks,
Rahul
I have used Asp.net MVC Grid and have grouped on a column(subject) and used groupheadertemplate to display count of rows.
I want to add custom data from model to the count in header.
How can I do that?
following is the code that I use:
@(Html.Telerik().Grid(Model)
.Name("Grid1")
.Columns(columns =>
{
columns.Bound(o => o.Type).Filterable(false).Title("Type");
columns.Bound(o => o.ReceiveDate).Title("Date");
columns.Bound(o => o.Subject).Title("Subject")
.Aggregate(c => c.Count()).
GroupHeaderTemplate(@<text>@item.Title: @item.Key (@item.Count)</text>);
columns.Bound(o => o.Comments).Title("Comments");
}).Groupable(grouping => grouping.Groups(groups =>
{
groups.Add(c => c.Subject);
}))
)
I want something like this:
@(Html.Telerik().Grid(Model)
.Name("Grid1")
.Columns(columns =>
{
columns.Bound(o => o.Type).Filterable(false).Title("Type");
columns.Bound(o => o.ReceiveDate).Title("Date");
columns.Bound(o => o.Subject).Title("Subject")
.Aggregate(c => c.Count()).
GroupHeaderTemplate(@<text>@item.Title: @item.Key (@item.Count + Convert.ToInt32(Model.MyCount))</text>);
columns.Bound(o => o.Comments).Title("Comments");
}).Groupable(grouping => grouping.Groups(groups =>
{
groups.Add(c => c.Subject);
}))
)
Is this possible?
Thanks,
Rahul