Hello, friends, I have a problem. Please help me. I have a table with a data volume of about 5 million. When I use IQueryable.ToDataSourceResult(request), it will take a lot of time. So I changed IQueryable.ToDataSourceResult(request) to IQueryable.ToDataSourceResultAsync(request), but it will be very slow when I want to get the Result.Data. Do you have a good solution, thank you.
Team
we are facing the issue binding the data into kendo.mvc.UI grid
here is the screenshots
my UI source code:
@(Html.Kendo().Grid<ClientOnboarding.Data.EF_COB_PortalUsr>()
.Name("CompanyDemographGrid")
.Selectable()
.Columns(columns =>
{
columns.Bound(c => c.name).Width(110);
columns.Bound(c => c.email).Width(110);
columns.Command(command =>
{
command.Edit();
command.Destroy();
}).Width(120);
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(5)
.Events(events => events.Error("error_handler"))
.Model(model =>
{
model.Id(mdel => mdel.Rec_id);
model.Field(mdel => mdel.Rec_id).Editable(false);
model.Id(mdl => mdl.name);
model.Field(mdl => mdl.name).Editable(false);
model.Id(mdl => mdl.email);
model.Field(mdl => mdl.email).Editable(false);
}
)
.Read(read => read.Action("BindAllDemographPortlUsr", "OnBoarding"))
.Update(update => update.Action("UpdateDemographPortlUsr", "OnBoarding"))
.Create(update => update.Action("AddDemographPortlUsr", "Grid"))
.Destroy(destroy => destroy.Action("DeleteDemographPortlUsr", "OnBoarding"))
)
.ToolBar(toolbar => toolbar.Create())
// Set grid editable.
.Editable(editable => editable.Mode(GridEditMode.InCell))
// Set grid sortable.
.Sortable()
// Set grid selectable.
.Selectable()
// Set grid pagable.
.Pageable(pageable =>
{
pageable.Refresh(true);
pageable.PageSizes(true);
})
)
This is my code:
Index.cshtml
@model IEnumerable<ManagePartsViewModel>
@(Html.Kendo().Grid(Model)
.Name("grid-parts")
.Columns(columns =>
{
columns.Bound(f => f.Identifier).Hidden();
columns.Bound(f => f.PartType);
columns.Bound(f => f.PartNumber);
columns.Bound(f => f.PartName);
columns.Bound(f => f.Barcode);
columns.Bound(f => f.Warehouse);
columns.Bound(f => f.Quantity);
})
.DataSource(dataSource => dataSource
.Ajax()
.Model(model =>
{
model.Id(p => p.Identifier);
model.Field(p => p.PartType);
model.Field(p => p.PartNumber);
model.Field(p => p.PartName);
model.Field(p => p.Barcode);
model.Field(p => p.Warehouse);
model.Field(p => p.Quantity);
})
.Aggregates(aggregates =>
{
aggregates.Add(p => p.PartType).Count();
})
.Group(groups =>
{
groups.Add(p => p.PartType);
})
.PageSize(8)
.ServerOperation(false)
)
.Groupable()
.Pageable()
.NoRecords()
.Deferred()
)
@section scripts
{
@Html.Kendo().DeferredScripts()
}
ManagePartsViewModel.cs
public class ManagePartsViewModel
{
public int Identifier { get; set; }
public string PartType { get; set; }
public string PartNumber { get; set; }
public string PartName { get; set; }
public string Barcode { get; set; }
public string Warehouse { get; set; }
public int Quantity { get; set; }
}
HomeController.cs
public class HomeController : Controller
{
private readonly IPartsService _partsService;
private readonly ILogger<HomeController> _logger;
public HomeController(IPartsService partsService, ILogger<HomeController> logger)
{
_partsService = partsService;
_logger = logger;
}
public async Task<ActionResult<IEnumerable<ManagePartsViewModel>>> Index(IEnumerable<ManagePartsViewModel> viewModel)
{
try
{
viewModel = await _partsService.GetParts();
return View(viewModel);
}
catch (Exception ex)
{
_logger.LogCritical(ex, ex.Message);
return BadRequest();
}
}
}
Throws me this exception:
Net MVC application there I want to update the telerik control as per the security team.
I am looking at the nuget packages and it giving me multiple options. The MVC projects that I have it is running on .net 4.7.2 so I am not sure which package to install. Also I used to think MVC4 is .net 4x.x but seem like it is not true so here is the Here are the multiple options for MVC:
Telerik.Ui.For.ASPNet>MVC3
Telerik.Ui.For.ASPNet>MVC4
Telerik.Ui.For.ASPNet>MVC5
Telerik.Ui.For.ASPNet.Core
I thought Telerik.Ui.For.ASPNet>MVC4 would work on 4.7.2 but it is not working as expected when I installed the several different packages.
Another confusion created to me by Telerik documentation. If it is referring to 3, 4 or 5 what does it really means?
" Telerik.UI.for.AspNet.Core—Telerik UI for ASP.NET Core Commercial.
Telerik.UI.for.AspNet.Mvc5—Telerik UI for ASP.NET MVC 5 Commercial.
Telerik.UI.for.AspNet.Mvc4—Telerik UI for ASP.NET MVC 4 Commercial.
Telerik.UI.for.AspNet.Mvc3—Telerik UI for ASP.NET MVC 3 Commercial.
I am using asp.net Mvc app 4.7.2 .net version. If I get the nuget package, how can I check which Jquery version it is supporting?
I have Jquery installed separately 3.6.0. in my mvc project.
Hello everyone, when I use grid to display data, the data is displayed normally when I use one grouping condition, but when I use multiple grouping conditions, an error will be reported. The database I use is mysql, and the error is when I call the todatasourceresult method
This is one grouping condition
This is two grouping condition
Here is my code and error information