So I have figured out how to give a grid a default sort order and it works good... I would like to also be able to give it a secondary sort order... first sort is "Bill Date" and then within rows that have the same bill date, they would be sort by "CoordinationOfBenefit".
Also of note, I have enabled multisort in the .Sortable
Thanks,
Jason
@(Html.Kendo().Grid<AccountClaim>()
.Scrollable(s => s.Height("auto"))
.Name("AccountClaimsGrid")
.HtmlAttributes(new { @class = "cursorLink", style= "height: 200px;" })
.DataSource(ds => ds.Ajax()
.Sort(sort => sort.Add("BillDate").Descending())
.Read("AccountClaimsData", "Workdriver", new { ProductName = ViewBag.SelectedProduct.ProductName, AccountId = Model.Account.AccountId })
//.PageSize(5)
.Events(e => e.Change("ClaimDataSourceChanged")))
.Columns(c =>
{
c.Bound(f => f.AccountClaimId).Visible(false);
c.Bound(f => f.ClaimNumber).Title("Claim Number").Width(125);
c.Bound(f => f.InsuranceCode).Title("Ins Code").Width(75);
c.Bound(f => f.CoordinationOfBenefit).Title("COB").Width(55);
c.Bound(f => f.ServiceDate).Title("Service").Format("{0:d}").Width(85);
c.Bound(f => f.BillDate).Title("Bill").Format("{0:d}").Width(85);
c.Bound(f => f.ClaimStatusRollupName).Title("Status").Width(100);
c.Bound(f => f.ClaimAmount).Title("Claim Amount").ClientTemplate("<span style='float: right;'>#=kendo.toString(ClaimAmount,'c')#</span>").Width(115);
c.Bound(f => f.PaidAmount).Title("Paid Amount").ClientTemplate("<span style='float: right;'>#=kendo.toString(PaidAmount,'c')#</span>").Width(110);
c.Bound(f => f.AdjustmentAmount).Title("Adjustment Amount").ClientTemplate("<span style='float: right;'>#=kendo.toString(AdjustmentAmount,'c')#</span>").Width(135);
c.Bound(f => f.PaidAmount).Title("Patient Amount").ClientTemplate("<span style='float: right;'>#=kendo.toString(PaidAmount,'c')#</span>").Width(125);
})
.Selectable(s => s.Mode(GridSelectionMode.Single))
.Sortable(s => s.SortMode(GridSortMode.MultipleColumn))
.Groupable(g =>
{
g.Messages(m =>
{
m.Empty("Drag Column Header Here to Group");
}
);
}
)
.Filterable()
.ColumnMenu()
.Events(e => e.Change("ClaimSelectionChanged"))
)
Also of note, I have enabled multisort in the .Sortable
Thanks,
Jason
@(Html.Kendo().Grid<AccountClaim>()
.Scrollable(s => s.Height("auto"))
.Name("AccountClaimsGrid")
.HtmlAttributes(new { @class = "cursorLink", style= "height: 200px;" })
.DataSource(ds => ds.Ajax()
.Sort(sort => sort.Add("BillDate").Descending())
.Read("AccountClaimsData", "Workdriver", new { ProductName = ViewBag.SelectedProduct.ProductName, AccountId = Model.Account.AccountId })
//.PageSize(5)
.Events(e => e.Change("ClaimDataSourceChanged")))
.Columns(c =>
{
c.Bound(f => f.AccountClaimId).Visible(false);
c.Bound(f => f.ClaimNumber).Title("Claim Number").Width(125);
c.Bound(f => f.InsuranceCode).Title("Ins Code").Width(75);
c.Bound(f => f.CoordinationOfBenefit).Title("COB").Width(55);
c.Bound(f => f.ServiceDate).Title("Service").Format("{0:d}").Width(85);
c.Bound(f => f.BillDate).Title("Bill").Format("{0:d}").Width(85);
c.Bound(f => f.ClaimStatusRollupName).Title("Status").Width(100);
c.Bound(f => f.ClaimAmount).Title("Claim Amount").ClientTemplate("<span style='float: right;'>#=kendo.toString(ClaimAmount,'c')#</span>").Width(115);
c.Bound(f => f.PaidAmount).Title("Paid Amount").ClientTemplate("<span style='float: right;'>#=kendo.toString(PaidAmount,'c')#</span>").Width(110);
c.Bound(f => f.AdjustmentAmount).Title("Adjustment Amount").ClientTemplate("<span style='float: right;'>#=kendo.toString(AdjustmentAmount,'c')#</span>").Width(135);
c.Bound(f => f.PaidAmount).Title("Patient Amount").ClientTemplate("<span style='float: right;'>#=kendo.toString(PaidAmount,'c')#</span>").Width(125);
})
.Selectable(s => s.Mode(GridSelectionMode.Single))
.Sortable(s => s.SortMode(GridSortMode.MultipleColumn))
.Groupable(g =>
{
g.Messages(m =>
{
m.Empty("Drag Column Header Here to Group");
}
);
}
)
.Filterable()
.ColumnMenu()
.Events(e => e.Change("ClaimSelectionChanged"))
)