Hello,
When using HtmlHelper I can do something like this if I want to change the UpdateText and CancelText to blank:
columns.Command(command => {
command.Edit()
.Text(" ")
.UpdateText(" ")
.CancelText(" ")
.HtmlAttributes(new { title = "Edit" });
command.Custom("Destroy")
.Click("showDeleteConfirmation")
.IconClass("k-icon k-i-trash")
.Text(" ")
.HtmlAttributes(new { title = "Delete" });
}).Width(75);
How do I accomplish the same thing with TagHelper? I tried checking to see if there's a canceltext or updatetext attribute but there is none.
<column width="75" title="Commands">
<commands>
<column-command text=" " name="edit" title="Edit" ></column-command>
<column-command text=" " name="cancel" title="Cancel" ></column-command>
</commands>
</column>
Thank you.
Context: This is an ASP.NET Core 6 project using MVC controllers. I have successfully gotten Grid widgets to work on another page which shares the same _Layout as the below page. As a result, I think it's unlikely that my issue is related to how Kendo is installed in the project.
The Problem
I am attempting to add a searchable DropDownList to my project. Though my ultimate goal is to use Virtualization to allow the search of a very large number of objects, I am unable to get the widget to function with a much small set of test data. No matter how I attempt to configure the widget or change how I pass data back to it I get the same result:
I have confirmed via the Visual Studio debugger that my Json response contains the correct data and contains no values that are null or empty.
My Code:
View
Note: SamAccountName is the field that should be displayed, used for text search, and selected as a value by the user.
Controller
Domain Model
As stated, the current code is much more simple than what I will eventually require, but I cannot even get this to work. I have tried structuring the controller about a hundred different ways, and the only change is that sometimes I get an error saying a field can't be recognized. Is this something to do with how I'm structuring my Json?
I've been beating my head against this for almost 2 days now, I could really use some help.
We have a context menu on an icon at the right of a grid. When we open a context menu, it initially opens with much of the menu hidden off the edge of the screen (see first attached image). If I open it again, the open position shifts so the whole menu is visible.
Ideally, what we would like is when the context menu opens, it is rendered so the right edge of the menu is aligned with the mouse cursor position rather than the left (don't really care if the menu text is left or right justified) (see second attached image)
I tried wrapping the context menu with a div which include the k-rtl class, but this made no difference.
Is this possible?
Currently using tagHelpers with UI for ASP.NET Core 2022.3.1109.
I have set up a kendo window to popup from a grid command. On the window is a form with cascading drop down lists and an optional input field. How do I set up kendo validation for the form in the template?
This is my template. Note, the inputs in this form are not bound to fields in the model for my view. This is a stand alone form separate from the model for the page.
<script type="text/x-kendo-template" id="AssignInventoryTemplate">
<form id="AssignInventoryForm" class="k-edit-form-container" action="@Url.Action("AssignInventory", "Inventory")" method="post" kendo-validator="true">
<style>
.k-edit-form-container {
max-height: 600px;
}
.k-edit-form-container .k-edit-buttons {
margin: 0;
padding: 8px 0px;
}
</style>
<input type="hidden" id="inventoryId" name="inventoryId" value="#:data.Id#" />
<input type="hidden" id="inventoryTypeId" name="inventoryTypeId" value="#:data.InventoryTypeId#" />
@Html.AntiForgeryToken()
<div class="k-edit-label">
<label>Assignment Type</label>
</div>
<div class="k-edit-field">
@(Html.Kendo().DropDownList()
.Name("assignmentTypeId")
.DataTextField("Name")
.DataValueField("Id")
.OptionLabel("Select Assignment Type")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetAssignmentPermissions", "InventoryType").Data("AssignmentTypeData");
});
})
.HtmlAttributes(new { required = "required", validationmessage = "Assignment type is required" })
.ToClientTemplate()
)
</div>
<div class="k-edit-label">
<label>Assign To</label>
</div>
<div class="k-edit-field">
@(Html.Kendo().DropDownList()
.Name("assigneeId")
.DataTextField("Name")
.DataValueField("Id")
.OptionLabel("Select Assignee")
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetAssignees", "Inventory").Data("FilterAssignees");
})
.ServerFiltering(true);
})
.Enable(false)
.AutoBind(false)
.CascadeFrom("assignmentTypeId")
.HtmlAttributes(new { required = "required", validationmessage = "Assignee is required" })
.ToClientTemplate()
)
</div>
# if(data.BulkItems) { #
<div class="k-edit-label">
<label>Quantity To Assign</label>
</div>
<div class="k-edit-field">
<span class="k-input k-textbox k-input-solid k-input-md k-rounded-md k-invalid" style="">
<input id="quantityToAssign" class="k-input-inner" type="number" min="1" max="#:QuantityOnHand#" name="quantityToAssign" value="1" required="required" validationMessage="Quantity to assign is required">
</span>
<div class="k-tooltip k-tooltip-error k-validator-tooltip k-invalid-msg field-validation-error k-hidden" data-for="quantityToAssign" id="quantityToAssign_validationMessage" data-valmsg-for="quantityToAssign">
<span class="k-tooltip-icon k-icon k-i-warning"></span>
<span class="k-tooltip-content">The Quantity To Assign field is required.</span>
<span class="k-callout k-callout-n"></span>
</div>
</div>
#}#
<div class="k-edit-buttons k-actions-end">
<button type="button" onclick="AssignInventorySubmit(event)" class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-primary">
<span class="k-icon k-i-check k-button-icon"></span>
<span class="k-button-text">Save</span>
</button>
</div>
</form>
</script>
This is the submit handler
function AssignInventorySubmit(e) {
var validator = $("#AssignInventoryForm").data("kendoValidator");
if (validator.validate())
$("#AssignInventoryForm").submit();
}
This is the error I'm getting in the console
Uncaught TypeError: can't access property "validate", validator is undefined AssignInventorySubmit http://localhost:55614/Inventory:209 onclick http://localhost:55614/Inventory:1 3 Inventory:209:17
I'm trying to add Kendo widgets to an ASP.NET Core 6 project that uses an MVC template. Which NuGet package do I need? The one for ASP.NET MVC or the one for ASP.NET Core?
I apologize if this is question has an obvious answer, I've been developing in .NET for < 1 year and was not able to figure this out via searching.
I'm also struggling to know which version of the package I need. If I do need the ASP.NET Core package, then should I use the most current stable release? That looks like it installs a large number of .NET 7.0 dependencies I don't need.
Hi
I have a wizard that loads partials as steps. Whenever I add more than one kendo component (for example a gauge and a slider) onto the same partial the second component renders outside of the wizards' container.
Please assist with this.
Kind Regards
IHostingEnvironment used in FileManager is long obsoleted.
Any plan to upgrade to IWebHostEnvironment soon?
thank you.
I tried to add a badge to a button after successfull retrieving data by an ajax call:
@(Html.Kendo().Button()
.Name("postbox")
.ImageUrl("../../images/mail-black.svg")
.Content("Postfach")
.Events(e => e.Click("onClickPostbox"))
.HtmlAttributes(new { @class = "button-box", style = style }))
When document is loaded i use ajax to retriev data:
$(document).ready(function () {
$.ajax({
contentType: 'application/json; charset=utf-8',
url: '/Dks/GetPostboxData',
type: 'GET',
cache: false,
data: null,
success: function (data) {
console.log(data);
if (typeof data !== 'undefined' && data.length > 0) {
var unreadDocuments = data.filter(doc => doc.Read == false);
console.log(unreadDocuments);
//Here I want to do something like this:
$("#postbox").data('kendoButton').Badge({
text: unreadDocuments.length,
shape: "circle",
themeColor: "error",
align: "top end",
visible: unreadDocuments.length > 0
});
}
},
error: function (error) {
console.log(JSON.stringify(error));
}
});
});
I didn't find a way to do this. Did I miss something?
Kind regards
Timo