Hi,
I have a problem while loading data to a grid. I want to disable Pagination and show all data on one page.
@(Html.Kendo().Grid<
WasteGridViewModel
>()
.Name("gridAllWaste")
.Columns(columns =>
{
columns.Bound(c => c.LocationCode).Title(@Helpers.Localize("gridLabel_locationCode").ToString());
columns.Bound(c => c.Timestamp).Format("{0:dd-MM-yyyy}").Title(@Helpers.Localize("gridLabel_timestamp").ToString());
columns.Bound(c => c.Value).Title(@Helpers.Localize("gridLabel_value").ToString());
if (User.Identity.IsInRole(UserRole.EditWaste))
{
columns.Command(command =>
{
command.Edit().Text(@Helpers.Localize("edit").ToString());
if (User.Identity.IsInRole(UserRole.AllAccess))
{
command.Custom(@Helpers.Localize("delete").ToString()).Click("openWindow");
}
}).Width(250);
}
})
.ToolBar(toolbar =>
{
if (User.Identity.IsInRole(UserRole.EditWaste))
{
toolbar.Create().Text(@Helpers.Localize("wasteGrid_add").ToString());
}
})
.Scrollable(s => s.Height("auto"))
.Groupable()
.Sortable()
.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("WasteEdit").DisplayDeleteConfirmation(false))
.Filterable(ftb => ftb.Mode(GridFilterMode.Row))
.Pageable(pageable => pageable
.Refresh(true)
.PageSizes(true)
.ButtonCount(5))
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(50)
.Events(events =>
{
events.Error("errorHandler");
events.RequestEnd("onRequestEnd");
})
.Model(model => model.Id(p => p.WasteId))
.Read(read => read.Action("GetAllWaste", "Waste"))
.Create(update => update.Action("CreateWaste", "Waste"))
.Update(update => update.Action("UpdateWaste", "Waste"))
.Destroy(update => update.Action("DeleteWaste", "Waste"))
))
Above code works fine, but when I remove Pageable and change PageSize to bigger number, for example 6000 grid doesn't show any data. I get respone 302 on my request:
Request URL:http://localhost:29786/Waste/GetAllWaste
Request Method:POST
Status Code:302 Found
Remote Address:[::1]:29786
Referrer Policy:no-referrer-when-downgrade
Repose Headers:
Cache-Control:private, s-maxage=0
Content-Length:157
Content-Type:application/json; charset=utf-8
Date:Tue, 20 Jun 2017 09:04:53 GMT
Location:/Error/?aspxerrorpath=/Waste/GetAllWaste
Server:Microsoft-IIS/10.0
X-AspNet-Version:4.0.30319
X-AspNetMvc-Version:5.2
X-Powered-By:ASP.NET
X-SourceFiles:=?UTF-8?B?QzpcUmVwb3NpdG9yaWVzXFdhc3RlXHNyY1xFbmdpZS5XYXN0ZVxFbmdpZS5XYXN0ZVxXYXN0ZVxHZXRBbGxXYXN0ZQ==?=
Thanks in advance for any help.
I am following the example form here:
https://demos.telerik.com/aspnet-mvc/grid/editing-popup
which the "Product Name" field is required, however there is nothing in the code the signals that
any directions are appreciated
tks
I have a kendo grid with a lot of columns and want to resize the grid width to it's container (a bootstrap column). By default, the grid tries to fit into the container
but with too many columns, it exceeds the container's width.
I tried to use .Scrollable() and now the grid fits to the container width. The unwanted side effect is that I get a vertical scrollbar. Can I achieve the goal without
.Scrollable()?
Hello,
I'm trying to implement a grid with row virtualization and groups, based on this example : https://demos.telerik.com/aspnet-mvc/grid/server-grouppaging-virtualization . But I see an odd behavior. When I group rows on two columns, then expand the first level group, in my case, there is no filter sent to the server, only group.
Here is the request sent by the grid in my case :
sort:
page: 1
pageSize: 50
group: RAISONSOCIALE-asc~LIBELLERIB-asc
filter:
take: 50
skip: 0
groupPaging: true
And here is the one in the example I use :
sort:
page: 1
pageSize: 50
group: CompanyName-asc
filter: City~eq~'Shady Point'
skip: 0
take: 50
groupPaging: true
Here is the grid :
Html.Kendo().Grid<SomeObject>()
.Name(
"ForecastListGrid"
)
.Groupable()
.Columns(columns =>
{
columns.Select().Width(50).HtmlAttributes(
new
{ @
class
=
"checkbox-align"
}).HeaderHtmlAttributes(
new
{ @
class
=
"checkbox-align"
});
columns.Bound(p => p.RAISONSOCIALE);
columns.Bound(p => p.CODE_FLUX);
columns.Bound(p => p.DATE_O).Width(100).Encoded(
false
).ClientTemplate(
"#=kendo.toString(kendo.parseDate(DATE_O,'dd/MM/yyyy'), '"
+
"dd/MM/yyyy"
+
"')#"
);
columns.Bound(p => p.DATE_V).Width(100).Encoded(
false
).ClientTemplate(
"#=kendo.toString(kendo.parseDate(DATE_V,'dd/MM/yyyy'), '"
+
"dd/MM/yyyy"
+
"')#"
); ;
columns.Bound(p => p.NOMBRE);
columns.Bound(p => p.LIBELLE);
columns.Bound(p => p.REFERENCE);
})
.Scrollable(scrollable => scrollable.Virtual(
true
))
.Height(500)
.DataSource(dataSource => dataSource
.Ajax()
.Events(events =>
events.Error(
"error_handler"
)
)
.Model(model =>
{
model.Id(p => p.ID);
})
.GroupPaging(
true
)
.PageSize(50)
.Read(
"LoadGrid"
,
"Test"
)
)
Is there something I'm missing ?
Thanks !
I have a simple page with an editor, I have the "createTable" tool added but not the "tableWizard" even so the Table Wizard button still shows up.
Is there a way besides css to remove/hide this button.
$("#editor").kendoEditor({
tools: [
{
name: "fontSize",
items: [
{ text: "1 (8pt)", value: "8pt", },
{ text: "2 (10pt)", value: "10pt", },
{ text: "3 (12pt)", value: "12pt", }
]
},
"bold",
"italic",
"underline",
"strikethrough",
"superscript",
"justifyLeft",
"justifyCenter",
"justifyRight",
"justifyFull",
"insertUnorderedList",
"insertOrderedList",
"indent",
"outdent",
"createLink",
"unlink",
"insertImage",
"createTable",
"addRowAbove",
"addRowBelow",
"addColumnLeft",
"addColumnRight",
"deleteRow",
"deleteColumn",
"viewHtml"
]
});
sort=&page=1&pageSize=30&group=&filter=Fields%5B3%5D.Value~contains~'hello'~or~Fields%5B3%5D.Value~contains~'statement'&Query=test
I have problem when using version 2020.1.114.
When I build the project locally, everything is still running normally, but when deployed to the IIS server and try to access the admin account, the error:
"f is not a constructor"
On local version of .NET Framework: 4.7.2, and on Server: 4.8
How do I handle this error?
Hi,
Please can anyone show me how I can set the value of a Select() column in the MVC grid?
I have a class which contains a boolean field that I would like to use to tick / untick the checkbox that the Select() column renders, but I can find no information on how to do it!
Any help greatly appreciated - please let me know if you require more info.
Thanks..Ed
I've recently started using ToDataSourceResultAsync extension methods, but noticed it is not allowed to pass cancellation token.
Cancellation token is widely supported in entity framework. And it has big benefits for long running queries to allow cancel them.
ToDataSourceResultAsync methods should support passing cancellation token as a parameter.