HI
I have a ASP.NET MVC/ASP.NET Core MVC compatibility question
about ASP.NET Core MVC Grid.
Why the following code not available in .NET Core 2.2 ?
.cshtml
columns.Template(template => { }).ClientTemplate(" ");
More detail :
.Columns(columns =>
{
...
columns.Template(template => { }).ClientTemplate(" ");
})
I think Telerik have the responsibility keep the code of recent version
(R2 2017, R2 2019...) to compatible with ASP.NET Core MVC.
Private implementation changed but should try to keep the public property/method the same.
It is the Value/Reason Why We choose Telerik.
Best regards
Chris
I have a situation where I don't know the number of columns I need at design time.
I want to do something like:
DateTime dt = DateTime.Now.Date;
int dayCount = 30;
.Columns(columns =>
{
for (int i = 0; i < dayCount ; i++)
{
columns.Bound(model.datedata).Title(dt.AddDays(i).ToString())… blah blah blah
}
}
Can someone show me an example of how to do this. Nothing I've found on the web seems to fit this bill.
Thanks …. Ed
Hi.
How I can change the value before export data to PDF?
I have a checkbox, and I need to change the format, I want to write YES/NO for checkboxes.
Is it possible to change PDF export to say Yes / No for check-boxes?
Not sure if the drawer is really meant for this, as it seems a bit more like a highly interactive tab control than just being a fly-out. But is there a way to have 2 drawers, one on the left and another on the right?
I'd like to have the left handle navigation, and the right be a fly-out for other various things.
Thanks
I hope this is an easy fix. I have a DropDownList in my Grid which seems to be working fine except the selected value is not being returned to the Controller Action. For example, when I select a new value for "Type" below, it still shows the original value in the model in the Controller. See "<--" NOTES BELOW.
Thanks very much for the help.
*** MODEL ***
public class SelectValueViewModel
{
public int Id { get; set; }
public string Code { get; set; }
public string Description { get; set; }
[UIHint("SelectValuesTypeDropDown")]
public string Type { get; set; } // <-- TRYING TO UPDATE THIS VALUE WITH THE DROP DOWN.
public List<SelectListItem> CodeTypes { get; set; }
}
*** VIEW ***
@(Html.Kendo().Grid<CCMC.View_Models.SelectValueViewModel>()
.Name("SelectValuesGrid")
.Columns(c =>
{
c.Bound(m => m.Code).Width(100);
c.Bound(m => m.Description).Width(100);
c.Bound(m => m.Type).Width(100);
c.Command(command => { command.Edit(); }).Width(200);
c.Command(command => command.Destroy()).Width(150);
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.InLine))
.Pageable()
.Sortable()
.Scrollable()
// .HtmlAttributes(new { style = "height:550px;" })
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Model(model =>
{
model.Id(sv => sv.Type);
// model.Field(sv => sv.Id).Editable(false);
})
.Events(events => events.Error("error_handler"))
.Read(read => read.Action("Read", "SelectValues"))
.Update(update => update.Action("Edit", "SelectValues").Data("sendAntiForgery"))
.Destroy(destroy => destroy.Action("Delete", "SelectValues"))
)
)
*** EDIT TEMPLATE ***
@model CCMC.View_Models.SelectValueViewModel
@(Html.Kendo().DropDownListFor(m => m.Type)
.DataValueField("Value")
.DataTextField("Text")
.BindTo(Model.CodeTypes)
.BindTo((System.Collections.IEnumerable)ViewData["SelectValueTypes"])
)
*** CONTROLLER ***
[AcceptVerbs("Post")]
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<JsonResult> Edit([DataSourceRequest] DataSourceRequest request, SelectValueViewModel model)
{
model.Type // <--- THE VALUE IS NOT UPDATED HERE. STILL HAS THE ORIGINAL VALUE.
}
Hello,
How to select an item by Id or datasorce value?
robert
Hello,
Is it possible to have scrolling in the Vertical Timeline?
(I have fix heigh of my views)
robert
Hello,
is there a way to overwrite the browsers (chrome and firefox) default behavior for middle or right click on custom buttons in a grid?
We are trying to get the middle mouse click on a custom command button in a grid.
With this line we only get the left mouse click, the middle and right are ignored/use the default browser commands
command.Custom("Details").Text(" ").Click("showDetails").IconClass("fas fa-eye");
Middle - new tab
Right - context menu
We tryed using JS on the mousedown event but it didn't work and in the "showDetails" method we only get the left mouse button
$('.k-grid-Details').on('mousedown', function (e) {
debugger
if (e.which == 1) {
e.preventDefault();
alert("middle button");
});