I've got a grid, using a pop-up editor. This works, but doesn't pick up the custom edit form in the EditorTemplatesfolder of the view.
The only way I can get it to work is to specify the full path in the TemplateName setting. I'm using version v2018.2.516.
@(Html.Kendo().Grid<PLCV_II.Models.PlcvuserList>()
.Name(
"grid"
)
.Events(e => e.Edit(
"onEdit"
))
.Columns(columns =>
{
columns.Bound(p => p.UserName).Title(
"User Name"
);
columns.Bound(p => p.FullName).Title(
"Full Name"
);
columns.Bound(p => p.SystemUser).Title(
"User"
);
columns.Bound(p => p.SystemAdmin).Title(
"Admin"
);
columns.Bound(p => p.SystemViewer).Title(
"Viewer"
);
columns.Bound(p => p.Banned).Title(
"Banned"
);
columns.Command(command => { command.Edit(); command.Destroy(); });
})
.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName(
"~/Views/Users/EditorTemplates/PlcvuserList.cshtml"
))
.Pageable()
.Sortable()
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.Model(m=>m.Id(p=>p.UserName))
.PageSize(15)
.Events(e => e.Error(
"error"
))
.Read(read => read.Action(
"RD_Users"
,
"Users"
))
.Create(a => a.Action(
"InsertUser"
,
"Users"
))
.Update(a => a.Action(
"UpdateUser"
,
"Users"
))
.Destroy(a => a.Action(
"DeleteUser"
,
"Users"
))
.Sort(s => s.Add(a => a.UserName).Ascending())
)
)
Thanks
Hello,
I created a asp.net core mvc solution. I also created a working build on Visual Studio Team Services. Next, I added a reference to Telerik.UI.for.AspNet.Core using the Telerik private Nuget feed. With this addition, the build on VSTS now fails.
I already had a Nuget Installer task in my build. I set the path to a nuget.config file in my repository. I tried with the hashed password and with a clear text password. No matter what I do, the build still fail. The build fails when the next task is executed. The task performs a dotnet restore on the asp.net mvc project.
Can you help ?
Regards,
Patrice
I have a treeview as follow,how to set expand?
<kendo-treeview name="TvTeam"
style="height:calc(100vh - 95px);width:100%;border-width:thin;border-color:gainsboro"
datatextfield="Name" on-change="TvTeamChange" >
<hierarchical-datasource>
<transport>
<read url="@Url.Content(MainPath+"?handler=LoadTree")" />
</transport>
<schema type="json">
<hierarchical-model id="Id" children="Child">
</hierarchical-model>
</schema>
</hierarchical-datasource>
</kendo-treeview>
Hello,
the default form-reset behaviour with preloaded inputs in HTML5 is setting the value back to the loaded value. For example: I open the customer-form and the name input is loaded with value = "Hans Müller". When i change the value to "Wilfried" and reset the form, the value is changed back to "Hans Müller".
With kendo-controls however, the behaviour is different. Resetting the form clears all fields, the value in the examples becomes empty.
Is it possible to change that behaviour to the "default" behaviour (Back to loaded values)?
Any help is much appreciated.
Dima.
I am evaluating your software for purchase and have encountered the following problem. I am trying to create a grid which will have a dropdown list editor for one of its columns. According to the comment in the thread https://www.telerik.com/forums/grid-with-drop-down-not-working it should be sufficient to create a foreign key column and then provide the data necessary to populate the dropdown. This isn't working for me. The editor for the personid column should be a dropdown list, but it isn't. No errors are shown when the project is built nor when the web page is displayed. Here is my code:
ScheduleGrid.cshtml
@{
ViewData["Title"] = "Schedule";
}
<h2>Schedule</h2>
@(Html.Kendo().Grid<SessionItemModel>()
.Name("ScheduleGrid")
.DataSource(d => d
.Ajax()
.Batch(true)
.PageSize(7)
.ServerOperation(false)
.Model(model => { model.Id(p => p.pkey); })
.Read(r => r.Action("Read", "Schedule"))
.Update(u => u.Action("Update","Schedule"))
.Group(g => g.Add(p => p.daypart)))
.Columns(c => {
c.Bound(m => m.pkey).Visible(false);
c.Bound(m => m.sessionkey).Visible(false);
c.Bound(m => m.daypart).Title("Day Part").Visible(false);
c.Bound(m => m.type).Visible(false);
c.Bound(m => m.slot).Title("Slot");
c.ForeignKey(m => m.personid, (System.Collections.IEnumerable)ViewData["persons"], "personid", "name").Title("Name");
c.Bound(m => m.editable).Visible(false);
})
.Groupable(false)
.Pageable()
.Editable(e => e.Mode(GridEditMode.InCell))
)
ScheduleController.cs
public class ScheduleController : Controller {
private sessionsRepository repo = new sessionsRepository();
public IActionResult Index() {
ViewData["persons"] = repo.GetPersons();
return View("ScheduleGrid");
}
public ActionResult Read([DataSourceRequest] DataSourceRequest request) {
List<SessionItemModel> sessions = repo.GetItems();
DataSourceResult result = sessions.ToDataSourceResult(request);
return Json(result);
}
[HttpPost]
public ActionResult Update([DataSourceRequest] DataSourceRequest request, [Bind(Prefix = "models")]IEnumerable<SessionItemModel> items) {
// update sessions here
List<SessionItemModel> sessions = repo.GetItems();
DataSourceResult result = sessions.ToDataSourceResult(request);
return Json(result);
}
}
I can set toolbar collapse use follow code:
@(Html.Kendo().Spreadsheet()
.Name("spreadsheet")
.HtmlAttributes(new { style = "width:100%" })
.Toolbar(false)
.Sheetsbar(false)....
but it dose not work use taghelper.
<kendo-spreadsheet name="spreadsheet" style="width: 100%" sheetsbar="false" >
<toolbar enabled="false" />
How to set urlcontent and width of window in javascript?
I have a window as follow:
<kendo-window name="WdAddCategory" modal="true"
content-url="@Url.Content("~/Setting/Dictionary_Add/1")"
width="400" visible="false"/>
and I open It in script:
var window = $("#WdAddCategory").data("kendoWindow");
window.open().center();
I want to change the content-url and width when I open it .how can I do that?
I'm getting the following errors every time I start a Compile on my Web Solution (SL5 application with some standard ASP.NET)
"Operation Failed"
An exception was thrown while initializing part of "NuGet.PackageManagement.VisualStudio.VSSolutionManager". GetFullVsVersionString must be called on the UI thread.
I have NO idea what this error message means and it ONLY started to happen AFTER I installed ASP.NET Core 2018.2.516 which is actually being refrenced in my Web Solution so I don't understand why this installation would cause this problem??
Rob.
I use follow code to selectrow ,but it dose not work.
grid.select("tr[data-uid='" + uuid + "']");
please help.