- Home
- Forum
- ASP.NET MVC
- Grouping on Grid
Grouping on Grid
Hi,
I want to group the grid by following the examples in the documentation, but I have an error "UnpaidBills_JSONTemplate"
This is the code that I use
@(Html.EJ().Grid<BillData>("UnpaidBills")
.Datasource(ds => ds.Json((IEnumerable<BillData>)ViewBag.UnpaidBills))
.AllowGrouping()
.GroupSettings(group => { group.GroupedColumns(col => { col.Add("Vendor");}); })
.PageSettings(paging => paging.PageSize(50))
.AllowFiltering()
.FilterSettings(filter => { filter.FilterType(FilterType.Excel); })
.Columns(col =>
{
col.Field("Id").IsPrimaryKey(true).Visible(false).Add();
col.Field("Vendor").HeaderText("Proveedor").TextAlign(TextAlign.Center).Width(70).AllowEditing(false).Priority(1).Add();
col.Field("RefNumber").HeaderText("Factura").TextAlign(TextAlign.Center).Width(35).AllowEditing(false).Add();
col.Field("TxnDate").HeaderText("Fecha").Format("{0:dd/MM/yyyy}").TextAlign(TextAlign.Center).Width(30).AllowEditing(false).Add();
col.Field("DueDate").HeaderText("Vencimiento").Format("{0:dd/MM/yyyy}").TextAlign(TextAlign.Center).Width(42).AllowEditing(false).Add();
})
)
And the result is like this
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Please Help. What am I doing wrong? What have I miss or overlook?
SIGN IN To post a reply.
1 Reply
KK
Karthick Kuppusamy
Syncfusion Team
September 27, 2016 01:23 PM UTC
Hi Dayne,
Thanks for Contacting Syncfusion support.
We have analyzed the provided code and we are not able to reproduce the reported issue at our end with the provided information.
Please find the code example.
|
@(Html.EJ().Grid<object>("FlatGrid")
.Datasource((IEnumerable<object>)ViewBag.datasource)
.AllowScrolling()
.AllowPaging()
.AllowGrouping()
.GroupSettings(group => { group.GroupedColumns(col => { col.Add("CustomerID"); }); })//grouped columns
.AllowFiltering()
.FilterSettings(filter => { filter.FilterType(FilterType.Excel); })
.SelectionType(SelectionType.Single)
.ToolbarSettings(toolbar =>
{
toolbar.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.Add);
items.AddTool(ToolBarItems.Edit);
items.AddTool(ToolBarItems.Delete);
items.AddTool(ToolBarItems.Update);
items.AddTool(ToolBarItems.Cancel);
});
})
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing(); })
.Columns(col =>
{
col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Visible(false).TextAlign(TextAlign.Right).Width(75).Add();
.
.
.
}))
|
For your reference we have created a sample based on your requirement and same it can be downloaded from the following location.
Online Link:
Please share the following details to us it would be helpful for us to find the prompt solution.
1.Please share the controller code.
2.Please reproduce the issue in the attached sample and revert back to us if it is possible.
3.Share more details about your requirement to reproduce the issue.
Regards,
K.Karthick.
SIGN IN To post a reply.
- 1 Reply
- 2 Participants
-
DA Dayne
- Sep 26, 2016 04:58 PM UTC
- Sep 27, 2016 01:23 PM UTC