Requirements |
|
Telerik Product and Version |
2014.3.1411.440 |
Supported Browsers and Platforms |
GoogleChrome |
Components/Widgets used (JS frameworks, etc.) |
UIGrid |
PROJECT DESCRIPTION
[enter description here, together with step-by-step instructions on how to use the project]
We have several pages where we have noticed that the sorting of the grid is not working. We are attempting to sorty by four columns but to no luck we are able to get the desired results.. Attached is a sample of the binding as well as the controller method that retrieves the method.
I have tried binding it both in the controller using OrderBy, ThenBy extensions as well as the sort in the grid binding. Additionally I have also sorted the results within the method that the controller calls and have reviewed it with LinqPad and it appears to be sorting correctly. However I cannot get it bind sorted in the grid. Any help will be appreciated.
Grid Binding
Scrollable(a => a.Height("auto"))
.Sortable()
.PrefixUrlParameters(false)
.Filterable()
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(new[] { 50, 100, 250, 500, 1000 })
.Messages(messages => messages.ItemsPerPage(" items are currently displayed"))
.ButtonCount(5))
.DataSource(dataSource => dataSource
.Server().PageSize(250)
.Sort(s =>
{
s.Add(c => c.EAN).Ascending();
s.Add(c => c.IngramSku).Ascending();
s.Add(c => c.BusinessYear).Descending();
s.Add(c => c.BusinessMonth).Descending();
Controller Method Logic
var viewModel = new ViewModels.RAM.VendorQuarterlyRevenueViewModel()
{
VendorId = vendorId,
VendorName = GetVendorName(vendorId),
sort = sort,
filter = filter,
group = group,
ShowDataGrid = true,
ReportDate = new ViewModels.RAM.ReportDateViewModel()
{
BeginDate = beginDate,
EndDate = endDate,
MaxDate = maxDate,
MinDate = minDate,
},
VendorQuarterlyRevenueData = _ramReportRepository.GetVendorQuarterlyRevenue(_ramReportRepository.GetContext(), beginDate, endDate, vendorId)
};
if (dataSourceRequest.Filters != null)
{
viewModel.VendorQuarterlyRevenueData = (IQueryable<
VendorRevenueModel
>)viewModel.VendorQuarterlyRevenueData.Where(dataSourceRequest.Filters);
}
foreach (var item in viewModel.VendorQuarterlyRevenueData)
{
viewModel.FreightRevenueSum += item.FreightRevenue;
viewModel.NetSalesSum += item.NetSales;
viewModel.RentalIncomeSum += item.RentalIncome;
}
return View("VendorQuarterlyRevenueReport", viewModel);