following is my code, but not bind to model
@Html.Kendo().CheckBoxGroupFor(m => m.weekOfDay).Items(i =>
{
i.Add().Label("ma").Value("1");
i.Add().Label("di").Value("2");
i.Add().Label("wo").Value("3");
i.Add().Label("do").Value("4");
i.Add().Label("vr").Value("5");
i.Add().Label("za").Value("6");
i.Add().Label("zo").Value("0");
}).Layout("horizontal")
cannot find any online information.
I have a read-only grid with paging enabled. It is retrieving the pages via AJAX. Is it possible to configure the grid to only make a AJAX request once for each page and to cache it after that? For example, when the user selects page 2, it makes an AJAX request to retrieve the page 2 records. Then the user selects page 1 again. I don't need it to go back to the server to request these. If it becomes stale, the user can just refresh the whole page. It sounded like the dataSource.transport.cache could do this, but I can't find any way of accessing that via the fluent DataSourceBuilder and it has next to no documentation. I tried setting ServerOperation to false thinking that might control caching, but that just prevented the paging params from being sent with the AJAX request. Can the Grid do this? Here is how my Grid is declared:
@(Html.Kendo().Grid<BatchHistoryVM>()
.Name(
"grd-batch-history"
)
.Columns(columns =>
{
columns.Bound(c => c.BatchNumber).Title(
"Batch #"
).HeaderHtmlAttributes(textCenterAttr);
columns.Bound(c => c.BatchDate).Title(
"Batch Date"
).HeaderHtmlAttributes(textCenterAttr).HtmlAttributes(textCenterAttr).Format(
"{0:d}"
);
columns.Bound(c => c.BatchAmount).Title(
"Batch Amount"
).HeaderHtmlAttributes(textCenterAttr).HtmlAttributes(textCenterAttr).Format(
"{0:c}"
);
columns.Bound(c => c.SettledBy).Title(
"Settled By"
).HeaderHtmlAttributes(textCenterAttr).HtmlAttributes(textCenterAttr);
})
.Pageable()
.NoRecords(
"There is no batch history available"
)
.Selectable(selectable =>
{
selectable.Mode(GridSelectionMode.Single);
selectable.Type(GridSelectionType.Row);
})
.Pageable(c => c.AlwaysVisible(
false
).ButtonCount(5))
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => { model.Id(bh => bh.BatchID); })
.PageSize(2)
.ServerOperation(
true
)
//Ask the server to do paging/sorting/filtering/grouping rather than doing it client-side on the already loaded data
.Read(read => read.Action(
"BatchHistory_Read"
,
"MPC"
))
.Events(events => events
.Error(
"clm.MPC.batchHistoryGrid_onError"
)
)
)
.Navigatable()
.Deferred()
//Wait for kendo script to load at the bottom of the page
)
Hi,
We are looking to upgrade your application. Currently it uses:
Telerik.Web.Mvc Version 2011.3.1115.235 (Extensions)
Telerik.Web.UI Version 2013.3.114.35 (Telerik RadControls for ASP.NET Ajax)
The Telerik ASP.Net Ajax I can update using the Wizard tool however the Telerik.Web.Mvc Extensions is no longer supported.
I am wondering what is the best way to replace it with the current Telerik standard?
Thanks,
Hi. I'm trying to find the current PageSizes for a grid. I know that I can get the current PageSize with GetOptions, but I haven't find a way to get all the PageSizes.
Is there a way to do it using GetOptions? or the only way will be to get the values directly from the dropdown?
Thanks.
Is there anyone know why the MultiSelect works fine for the first item. After first one select, it will not work properly( please see the screen shot). type a letter then all matched item will be selected. Click any one then the box will reset.
cshtml
@(Html.Kendo().MultiSelect()
.Name("Users")
.DataTextField("FullUserInfo")
.DataValueField("UserID")
.Placeholder("Type Last Name or First Name")
.DataSource(source => {
source.Read(read =>
{
read.Action("GetFilterUser", "Method");
})
.ServerFiltering(true);
})
)
Controller
[HttpGet]
public JsonResult GetFilterUser(string text)
{
personList = (IEnumerable<UserListboxDataViewModel>)
dataService.GetAllPersonsforListBox();
if (!string.IsNullOrEmpty(text))
{
personList = personList.Where(p =>
(p.FullUserInfo.Contains(text))).ToList();
}
return Json(personList, JsonRequestBehavior.AllowGet);
}
I have an MVC application running on the C: drive of my web server. I need to access files on the same machine, but a different drive, located at D:\Files.
I can't find an example of how this is accomplished. The FileManager demo uses the application content folder for file storage, so that is not much help in this instance. I've searched this forum, google and SO but I can't find a working example of how this is accomplished. Most of the answers I've found simply point back to the FileManger demo without any explanation.
I would certainly appreciate any insight you can provide for this topic.
Thanks!
Hi,
I would like to know if there is a way to define custom shapes or to get predefined shapes as in Syncfusion (i.e. question or diamond) when using diagram with ASP.NET MVC
thanks
Ray
Is there a way I can accomplish the following using the MVC wrapper?
https://docs.telerik.com/kendo-ui/controls/data-management/grid/how-to/various/foreign-key-column-sorting-by-text
Hi,
I am creating my own MVC Helper to wrap the Form component (serverside).
Inside that helper, I do something like this to create a custom html input element event:
StringBuilder sb = new StringBuilder();
string strSaveCall = $"SaveDetailItem(null, '{_formName}', '{_saveActionUrl}', null, null);"; // '/Home/Save'
string onkeyDownEvt = _htmlHelper.Raw("if (event.keyCode == 13) { " + strSaveCall + " }").ToHtmlString();
This renders the following html:
<input type="text" id="LastName" name="LastName" ...
onkeydown="if (event.keyCode == 13) { SaveDetailItem(null, &#39;myForm&#39;, &#39;/Home/Save&#39;, null, null); }" ....">
But I would like to see it rendered without the escaped characaters, like:
if (event.keyCode == 13) { SaveDetailItem(null, 'myForm', '/Home/Save', null, null); }"
How can I achieve this ?
Martin