Hello,
I have this code on my index.cshtml:
@(Html.Kendo().MultiSelect()
.Name("selectedmembers")
.Placeholder("Please select the members on the job...")
.DownArrow(true)
.AutoClose(false)
.DataTextField("MemberName")
.DataValueField("MemberId")
.Filter("contains")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetPeople", "Combo");
});
})
)
And my GetPeople code looks like this:
public JsonResult GetPeople(string text)
{
using (var db = new chilternModel())
{
var members = db.Members.Select(member => new Member()
{
MemberName = member.MemberName,
MemberId = member.MemberId
});
return Json(members.ToList());
}
}
When I run the code I get undefined as the text value. The database is a mySql running locally.
I have checked the members variable and it has the appropriate information for a jsonResult to be returned, but the control seems to ignore the text field (and I assume the MemberId as well)
Thanks in advance.
Michael
Hello,
I am trying to build a grid that has a combobox in it that should be filled from an Ajax request. But based on the demo on the page, I am not being able to determine where the combobox is filled.
I appreciate any help on the matter.
Regards,
Alexandre
Currently we are using Telerik ASP.NET Core 2024.2.514 and in MVC HtmlHelper methods such as Kendo().DatePickerFor() do not support properties of C# type DateOnly.
Is this supported in a version later than we are using or is if not is it on project plans for future inclusion?
Same applies for TimeOnly.
In 2024.1 and 2024.2 (perhaps other versions, but those are the two I tried), using ToDataSourceResult to filter on a property whose type is DateOnly results in an InvalidCastException. This is due to ToDataSourceResult using .NET's Convert.DefaultToType which does not support converting to DateOnly. Per https://github.com/dotnet/runtime/issues/73074 (which is about a different but related method), the team at Microsoft is adamant about not adding the support because the Convert methods have fallen out of vogue. As a workaround, I wrote a method to scan through the filter tree of the DataSourceRequest and pre-convert any value corresponding to a DateOnly property from a string or DateTime to a DateOnly so that it will not need to be converted within ToDataSourceResult, but that is quite tedious since I have to do that to each of my applications and call it before every call to ToDataSourceResult. It would be nice if ToDataSourceResult could handle this case internally.
For reference, here is the relevant part of the stack trace:
I have a notification that looks like this:
<kendo-notification name="notifications" stacking="NotificationStackingSettings.Down" auto-hide-after="2500">
<position pinned="true" top="30" right="30" />
<popup-animation>
<open duration="700" />
<close duration="250" />
</popup-animation>
<templates>
<notification-template type="success" template='<p class="text-lead"><i class="fas fa-check-circle"></i> #=message#</p>'>
</notification-template>
<notification-template type="error" template='<p class="text-lead"><i class="fas fa-exclamation-circle"></i> #=message#</p>'>
</notification-template>
</templates>
</kendo-notification>
I want to avoid using unsafe-eval in the Content Security Policy. How do I convert the templates? The instructions given here are not clear in this case. I want to avoid using a client-side handler if possible.
Thank you
Hi Team,
Is it possible to deactivate the editing buttons (create, edit, delete) from a certain level of the node tree, e.g. deactivating the Create button in case of an ending node (leave) where child elements are not allowed.
Here's the code:
@(Html.Kendo().TreeList<Node>()
.Name("treelist")
.Toolbar(toolbar => toolbar.Create().Text("Add new Node"))
.Toolbar(toolbar =>
{
toolbar.Search();
})
.Toolbar(tools => tools.Excel())
.Excel(excel => excel.FileName("Export.xlsx").ProxyURL(Url.Action("ExportToExcel")))
.Columns(columns =>
{
columns.Add().Field(f => f.ElementId).Width(250);
columns.Add().Field(e => e.Name);
columns.Add().Width(400).Command(c =>
{
c.CreateChild().Text("Add child");
c.Edit().Text("Edit");
c.Destroy().Text("Deactivate");
})
.HtmlAttributes(new
{
style = "text-align: center;"
});
})
.Filterable()
.Sortable()
.DataSource(dataSource => dataSource
.Create(create => create.Action("Create", "TreeHandler"))
.Read(read => read.Action("GetData", "TreeHandler"))
.Update(update => update.Action("Update", "TreeHandler"))
.Destroy(delete => delete.Action("Destroy", "TreeHandler"))
.ServerOperation(true)
.Model(m =>
{
m.Id(f => f.ElementId);
m.ParentId(f => f.ParentId);
m.Expanded(true);
m.Field(f => f.Name);
m.Field(f => f.ElementType);
m.Field(f => f.ParentId);
})
).Height(540).Pageable(p=>p.PageSize(15).PageSizes(true))
)
Code is taken from Tutorial: Editing in ASP.NET Core TreeList Component Demo | Telerik UI for ASP.NET Core
Kind regards,
Mario
I need to display a dataset of a scanned item where the dataset is a list of 3D values (X, Y and Z)
I want the diagram to display the Image as be a top-down view, using X and Y coordinates from the dataset using the the height (Z) to color encode the point using a color gradient.
Using a 3D RadCartesianChart3D component I have created something similar, see the attached RadCartesianChar3D image.
What I need now is a 2D image, something like what I try to illustrate in the attached ColorEncodedItem image.
What I need to know, is what component I should use for this job.
I expect that using a RadCartesianChart3D will be to CPU intensive for the platform I will be running this software on + I don't know, how to make a top-down view of a diagram using this component
Hi,
I'm developing an ASP.NET Core MVC app targeting .NET 8 with VS2022 on a x64 Windows 10 Professional.
The app has one grid using a custom popup editing template with some editing Kendo widgets in it.
I've found that, if I omit to call ".Deferred()" on the Grid or ".ToClientTemplate()" on every widgets inside the custom template, I got the following error trying to run or compile my app from Visual Studio:
Error CS0012 The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'
The very same happens if I try to run or compile the example project found in the UI for ASP.NET Core MSI installer package!
I'm using a trial version of Telerik.UI.for.AspNet.Core 2024.2.514.
Can you help me, please?
This link says:
To remove the unsafe-eval
keyword from the meta tag of your application, you must convert all client templates (inline, external, and partial templates) into CSP-compatible templates.
@(Html.Kendo().TreeMap()
.Name("tmReason")
.DataSource(ds => ds
.Read(r => r.Url("?handler=ReadTop5Reasons"))
.Model(m => m.Children("Items"))
)
.Type(TreeMapType.Squarified)
.Template(Html.Kendo().Template().AddHtml("${data.text}: ${data.dataItem.Number}"))
.ValueField("Number")
.TextField("Category")
.ColorField("color")
)
<script id="tmplReasonTooltip" type="text/x-kendo-template">
<p>#=target[0].innerHTML#</p>
</script>
@(Html.Kendo().Tooltip()
.For("#tmReason")
.Filter(".k-leaf")
.Position(TooltipPosition.Top)
.ContentTemplateId("tmplReasonTooltip")
.Width(200.0)
)
Hi all,
Need some assistance with this one please - may be something simple but I've been battling to get this right all day.
I have following this article to build a step-wise wizard: https://www.telerik.com/blogs/step-wise-forms-with-asp-net-mvc-and-kendo-ui
Everything is working well and as expected however on my first tabstrip (content loaded from a partialview) I have several inputs for various fields.
Some fields display correctly and some is smaller in height. They are defined all the same in the source file (with the exception of the field name). Both the below samples point to string fields.
I don't have any css defined elsewhere, just bootstrap and fluent style in use.
Eg:
Form declaretion:
...
@using (Html.BeginForm("AddCRMClient", "CRM", FormMethod.Post, new { role = "form" }))
...
Displays correctly:
...
<div class="col-7">
@Html.LabelFor(m => m.CustomerName, new { @class = "form-label" })
@(Html.Kendo().TextBoxFor(m => m.CustomerName)
.HtmlAttributes(new { placeholder = "", type = "text", @class = "k-textbox" })
)
</div>
...
Height is smaller:
...
<div class="col-6">
@Html.LabelFor(m => m.VATNumber, new { @class = "form-label" })
@(Html.Kendo().TextBoxFor(m => m.VATNumber)
.HtmlAttributes(new { placeholder = "", type = "text", @class = "k-textbox" })
)
</div>
...
This is the result:
As you can see there are many controls that does not display correctly.
When I look at these via dev tools, I can see the controles that display correctly does have 2 spans which encapsulates the input, the ones that does not display correctly only has one span.
Eg:
vs.
Layout file to show referenced css, js files.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewData["Title"] - VAPS Admin System</title>
<environment names="Development">
<link rel="stylesheet" href="~/lib/bootstrap/css/bootstrap.css" />
</environment>
<environment names="Staging,Production">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css"
asp-fallback-href="~/lib/bootstrap/css/bootstrap.min.css"
asp-fallback-test-class="sr-only" asp-fallback-test-property="position" asp-fallback-test-value="absolute" />
</environment>
@*Core Content Start*@
<link rel="stylesheet" href="~/css/kendofonts.css" />
<script src="~/js/site.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/js/all.min.js" integrity="sha512-GWzVrcGlo0TxTRvz9ttioyYJ+Wwk9Ck0G81D+eO63BaqHaJ3YZX9wuqjwgfcV/MrB2PhaVX9DkYVhbFpStnqpQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link href="@Url.Content("~/lib/kendo-ui/styles/fluent-main.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/lib/jquery/jquery.min.js")"></script>
<script src="@Url.Content("~/lib/kendo-ui/js/jszip.min.js")"></script>
<script src="@Url.Content("~/lib/kendo-ui/js/kendo.all.min.js")"></script>
<script src="@Url.Content("~/lib/kendo-ui/js/kendo.aspnetmvc.min.js")"></script>
<link rel="stylesheet" href="~/css/site.css" />
<script src="~/lib/kendo-ui/js/cultures/kendo.culture.en-ZA.min.js"></script>
@*Core Content End*@
.............
What would cause this, and how do I fix it?
Using Telerik.UI.for.AspNet.Core Version 2023.3.1114 with VS 2022.
Thanks in advance.