look this:
columns.Bound(p => p.Lock).ClientTemplate("<input onclick='return false;' type='checkbox' #= Lock? checked='checked' : ' ' # />");
It's completely normal but I always get Invalid template
It's just happen with Hierarchy grid, and with normal grid it works fine.
<script id="LoadWeek" type="text/kendo-tmpl">
@(Html.Kendo().Grid<WorkingWeek>()
.Name("grid_#=Id#")
.Columns(columns =>
{
another column bound
columns.Bound(p => p.Lock).ClientTemplate("<input onclick='return false;' type='checkbox' #= datChuan ? checked='checked' :'' # />");
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(5)
.Read(read => read.Action("HierarchyBinding_Week", "WeeklyProgress", new { WorkingMonthId = "#=Id#" }))
)
.Pageable()
.Sortable()
.ToClientTemplate()
)
</script>
Hello,
Is it possible to have a different template per row according to a value of a column in the grid?
Example:
If ForecastType=1
If ForecastType=2
If ForecastType=3
yellow areas are editable
I have an asp.net core razor page app im trying to make an edit page I would like to add a Telerik grid to bind to a list of objects that I have declared as a bind property. The Grid is displaying great but when the form posts back I want the grid to modelbind to the list and pass back in the new records, changed records, and delated actions done in the grid. This is not happening and if I use the bind property or pass the parameter on the onpost I can't get the grid values passed back.
In the code behind
public class HowToUseSteps
{
public int Id { get; set; }
public string Steptext { get; set; }
}
[BindProperty]
public List<HowToUseSteps> _Steps { get; set; }
in the cshtml
<form method="post">
@(Html.Kendo().Grid(Model._Steps)
.Name("HowToUseSteps")
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Columns(columns =>
{
columns.Bound(column => column.Id).Title("Id").Width(100);
columns.Bound(column => column.Steptext).Title("Step");
columns.Command(command => command.Destroy()).Width(150);
}
)
.ToolBar(toolbar =>
{
toolbar.Create();
toolbar.Save();
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.ServerOperation(true)
)
<button type="submit" class="btn btn-success">Save</button>
</form>
I know i can call separate on change on delete events on the grid. but i was hoping to use databinding on a postback instead. any help would be appricated.
Thanks
Ross
How to display the real value without formating.
Default formating is N2 :
Value : 10.567
Display: 10.56 or 10.57 with round
Change formating to N8 :
Value : 10.5678
Display: 10.56780000
I would like to display 10.567 or 10.5678 without 0, as in edition.
Thx.
public class RegisterViewModel { public int Id { set; get; } [EmailAddress] public string Email { get; set; } public string RegObl { set; get; } public string RegRaion { set; get; } public IFormFile FilesImageUser { get; set; } }
Register.cshtml
@model exchange.Models.RegisterViewModel
@using Kendo.Mvc.UI
@Html.AntiForgeryToken()
<div class="form-group"><label asp-for="ImageUser">Фото</label>
@(Html.Kendo().Upload()
.Name("FilesImageUser")
.Async(a => a
.Save("ImageUserTemp_Save", "File")
.Remove("ImageUserTemp_Remove", "File")
.AutoUpload(false)
)
.Events(e => e
.Success("onSuccessImageRegister")
//.Select("onSelectImageRegister")
)
.ShowFileList(false)
.Multiple(false)
//.DropZone(".dropZoneElement")
.Validation(validation =>
{
validation.AllowedExtensions(new string[] { ".jpg", ".jpeg", ".png", ".bmp"});
})
)
<div class="wrapper"><div id="imageUserRegister"></div></div></div>
<button type="submit" class="btn btn-success">Регистрация</button>
public async Task<ActionResult> Register(RegisterViewModel model)
{
if (!ModelState.IsValid) return View(model);
..........
}
how to make the "upload" data loaded into the model and further processed in the controller. At the moment, the data "null" ?
<label for="poNumTextbox" style="color:white; line-height:3.2; padding-right:5px; padding-top:5px">PO#</label>
<div class="k-textbox" style="width:120px">
@(Html.Kendo().NumericTextBox<int>()
.Name("poNumTextbox")
.Format("#")
.Decimals(0)
.RestrictDecimals(true)
.Placeholder("PO #")
.HtmlAttributes(new { style = "font-size:inherit; width: 100%" })
.Spinners(false)
)
</div>
I am trying to figure out how to keep leading zeros. Numbers can be something like "00045678" with max 8 chars. However when you click out of the textbox, it is converted to "45678" I'm using numeric textbox to prevent entry of non-numeric characters. Also no decimals or special characters - numbers only.
Thank you.
edit: nevermind, found that MaskedTextbox gives me what I need without having to misuse NumericTextbox
Hi,
I am trying to get the id of the selected entry in a combo box on a Razor page.
I modelled the code on the DatePicker example from the Razor examples.
I added a DatePicker to my page along with my Combo box.
The page loads and the combo box loads its entries. When I make a selection, the page does a post and my OnPost handler is called.
The value for the DatePicker is there but the ComboBox returns a null value.
I have enclosed screen shots of my cshtml and cshtml.cs pages. The DatePicker and ComboBox are setup identically as far as I can tell.
Any suggestions on what I might be doing wrong.
Thanks,
Charlotte
Running
$("#tabStrip").kendoTabStrip().data("kendoTabStrip").activateTab($("#tabstrip-tab-3"));
on Doc Ready in the demo throws a Javascript error and the 3rd tab("Moscow") is not selected.
"Uncaught TypeError: Cannot read properties of undefined (reading 'length')" - logged in Console
What am I doing wrong?
So, basically I do not want clients to have the options to delete or rename files which they have by default when you use FileManager through tag helper. All I need is clients to be able to view available files and download them. Is there any alternative to FileManager to achieve this feature? I greatly appreciate any help or directions. Thank you.
Edit: Using <Context-Menu> tag helper inside the filemanager component accomplished what I was looking for.