I have a form as follows where it fires validation for text box controls but not for file upload
<form id="frmItem">
<table class="table table-bordered">
<thead class="bg-dark text-center text-white">
<tr>
<th colspan="2">Add/Modify Item</th>
</tr>
</thead>
<tbody>
<tr>
<td style="width:404px;">Item ID Name</td>
<td>
@(Html.Kendo().TextBox().Name("txtItemName")
.HtmlAttributes(new { placeholder = "Item ID Name", required = "required", validationmessage = "Enter Item ID Name" }))
</td>
</tr>
<tr>
<td>UN Number</td>
<td>
@(Html.Kendo().TextBox().Name("txtUnNumber")
.HtmlAttributes(new { placeholder = "UN Number", required = "required", validationmessage = "Enter UN Number" }))
</td>
</tr>
<tr>
<td>Packing Instructions</td>
<td>
@(Html.Kendo().TextBox().Name("txtPackingInstructions")
.HtmlAttributes(new { placeholder = "Packing Instructions", required = "required", validationmessage = "Enter Packing Instructions" }))
</td>
</tr>
<tr>
<td>SDS Sheet</td>
<td>
@(Html.Kendo().Upload().Name("SdsSheet")
.Multiple(false)
.HtmlAttributes(new { required = "required" }))
</td>
</tr>
<tr>
<td>Cargo Only?</td>
<td>@(Html.Kendo().CheckBox().Name("txtCargoOnly"))</td>
</tr>
<tr>
<td>Example Shipment Ground (Fully Regulated)</td>
<td>@(Html.Kendo().Upload().Name("GroundShipment"))</td>
</tr>
<tr>
<td>Example Shipment Next Day Air (Fully Regulated)</td>
<td>@(Html.Kendo().Upload().Name("NextDayShipment"))</td>
</tr>
<tr>
<td>Example Shipment Freight (Fully Regulated)</td>
<td>@(Html.Kendo().Upload().Name("FreightShipment"))</td>
</tr>
<tr>
<td>Example Shipment Ground (Limited Quantity)</td>
<td>@(Html.Kendo().Upload().Name("GroundShipmentLimited"))</td>
</tr>
<tr>
<td>Example Shipment Next Day Air (Limited Quantity)</td>
<td>@(Html.Kendo().Upload().Name("NextDayShipmentLimited"))</td>
</tr>
<tr>
<td>Example Shipment Freight (Limited Quantity)</td>
<td>@(Html.Kendo().Upload().Name("FreightShipmentLimited"))</td>
</tr>
<tr>
<td colspan="2">
<button class="k-button k-button-solid-primary k-button-solid k-button-md k-rounded-md" type="submit">Submit</button>
</td>
</tr>
</tbody>
</table>
</form>
<script>
$(document).ready(function () {
var validator = $("#frmItem").kendoValidator().data("kendoValidator");
$("#frmItem").submit(function (event) {
event.preventDefault();
if (validator.validate()) {
} else {
}
});
});
</script>
Am I missing a configuration option? I have a menu which has several levels of menus. With "Security Trimming" enabled, root level objects get trimmed with no issues. Parents which have their children objects "trimmed", still show up. Example:
@(Html.Kendo().Menu() .Name("Menu") .SecurityTrimming(true) .Items(items => { items.Add().Text("Home").Action("Index", "Home"); items.Add().Text("Owners").Action("Index", "Owners"); items.Add().Text("Interred").Action("Index", "Interred"); items.Add().Text("Maintenance").Items(itm => { itm.Add().Text(@"Sections/Lots/Spaces").Action("Index", "MaintainSpaces"); itm.Add().Text("Search Tags").Action("Index", "MaintainSearchTags"); itm.Add().Text("Undertakers").Action("Index", "MaintainUndertakers"); itm.Add().Text("Reclaim Spaces").Action("Index", "MaintainReclaimSpaces"); itm.Add().Text("Research Tool").Action("Index", "MaintainResearchTool"); itm.Add().Text("Headstones").Action("Index", "MaintainHeadstones"); }); items.Add().Text("Reports").Items(itm => { itm.Add().Text("Available Spaces").Action("Index", "ReportsPage"); }); }) )
As you can see the "Maintenance" and "Reports" menu items are still visible. An example situation would be :
A unauthorized user sees the "Home" button, and everything else should be trimmed. While the actual actions are getting trimmed, the "Maintenance" and "Reports" menu items (with nothing in them) are still there.
Am I missing a configuration option to also remove parents?
Hello,
I've use kendo Grid MVC for my project and want to change the Input type when filter (in one field):
What i want like the below image:
Have any way to config this ?
<div style="height: calc(100vh - 220px);">
Thanks
I have a C# ASP.NET MVC application where I populate a Kendo grid with data from an Ajax call. I need to have one of the grid columns displayed with a dropdown list. I also need to set the selected value of the dropdown list.
This is the code for the grid:
@(Html.Kendo().Grid<TaxCertApp.ViewModels.ParcelViewModel>()
.Name("DetailedParcelGrid")
.AutoBind(true)
.Columns(columns =>
{
columns.Bound(parcel => parcel.ParcelKey)
.ClientTemplate("<button type='button' class='btn btn-taxapp btn-primary assesment-taxyear-add' id='btnAddTaxYear'><b>Add Tax Year</b></button>")
.Title("")
.Width(200);
columns.Bound(parcel => parcel.ParcelKey)
.ClientTemplate("<span class=\"assesment-parcel-edit glyphicon glyphicon-edit\" style=\"color: rgb(40, 96, 144)\"></span></a>")
.Title("")
.Width(30);
columns.Bound(parcel => parcel.LotNo).Title("Lot #").Width(50);
columns.Bound(parcel => parcel.AssembledTaxDescription).Title("Tax Description").Width(140);
columns.Bound(parcel => parcel.SchoolDistrict).Title("School District").Width(120);
columns.Bound(parcel => parcel.ParcelStreetNo).Title("Street Number").Width(110);
columns.Bound(parcel => parcel.ItemNo).Title("Item").Width(50);
columns.Bound(parcel => parcel.Class).Width(50);
columns.Bound(parcel => parcel.ParcelStatusList)
.Title("Parcel Status")
.Width(150)
// .ClientTemplate("#=SeeList(ParcelStatusList)#");
.EditorTemplateName("DropDownEditor");
columns.Bound(parcel => parcel.ParcelNotes).Title("Parcel Notes");
})
.Scrollable()
.HtmlAttributes(new { style = "height:550px;" })
.ClientDetailTemplateId("template")
.DataSource(dataSource => dataSource
.Ajax()
.Model(model => model.Id(n => n.CaseKey))
.Read(read => { read.Action("GetDetailedParcelDetails", "Parcel").Data("{ CaseKey: " + @Model.CaseKey + "}"); }))
.Events(events => events.DataBound("dataBound"))
)
This is the code in the DropDownEditor.cshtml:
@using System.Collections
@model System.String
@(Html.Kendo().DropDownListFor(m => m)
.BindTo((IEnumerable)ViewData["ParcelStatusList"])
.OptionLabel("- Select Parcel Status -")
)
I included an image of the grid that gets generated. I also included an image of the console.log when the code executed the .ClientTemplate code which looks like this:
function SeeList(parcelStatusList) {
console.log(parcelStatusList);
var obj = JSON.stringify(parcelStatusList);
console.log(obj);
return parcelStatusList;
}
Any suggestions on what is preventing the dropdown from displaying properly?
Thank you.
Hello, I am dealing with an issue while implementing a hierarchy grid using server binding. I need to access data child in server so I can modify this data as I need.
I.E.
columns.Bound(pet => pet.Origen).Width(100).HtmlAttributes( new {@title = item.title});
I would need to display the tooltip I have in my model, but the problem is that "item" reffers to the father row, not the child. How can I get this done?
I don't know if I am using the correct approach here, any help would be appreciated.
Thanks and best regards.
Hi,
I am trying to implement same way as ASP.NET Core PDF Export Key Features Demo | Telerik UI for ASP.NET Core
but Its exporting in client side but it's not going to controller. Don't know what mistake I am doing. Is there a way to send the pad to controller and send it to email attachment. Below is my code.
$("#btnSubmit").on("click", function (e) {
e.stopPropagation();
e.preventDefault();
var sigval = signature.value();
$('#lblSearchError').text('');
if (sigval === undefined || sigval === '') {
$('#lblSearchError').text('*Signature field is required.');
} else {
var data = $("#submitForm").serializeArray();
var obj = { name: 'signature', value: sigval };
data.push(obj);
// Convert the DOM element to a drawing using kendo.drawing.drawDOM
kendo.drawing.drawDOM($("#mainContect"))
.then(function (group) {
// Render the result as a PDF file
return kendo.drawing.exportPDF(group, {
paperSize: "auto",
margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" }
});
})
.done(function (data) {
// Save the PDF file
kendo.saveAs({
type: 'POST',
dataURI: data,
fileName: "Provider.pdf",
proxyURL: '@Url.Action("Submit", "Provider")'
});
});
}
});
I tried proxyURL AND URL none of them worked. When I clicked on submit button it's just downloading the pdf file. But it not hitting controller.
and in controller
[HttpPost]
public ActionResult Submit(string contentType, string base64, string fileName)
{
//if (!ModelState.IsValid)
//{
// data.Id = 0;
// return Json(data, JsonRequestBehavior.AllowGet);
//}
//var providerData = portalServices.saveProviderData(data);
// return Json(providerData, JsonRequestBehavior.AllowGet);
var fileContents = Convert.FromBase64String(base64);
return File(fileContents, contentType, fileName);
}
The Value Axis isn't showing a DateTime like '5/1/2023 10:00 AM' which is the same DateTime format that the data from my stored procedure is using. I'd like the value axis to show each hour of the day.
Attached is a screenshot of the grid. Thanks!
Here's the chart's code:
@(Html.Kendo().Chart<BatchPlantHourlyOutputViewModel>()Hi,
I created a TileLayout with MVC
@(Html.Kendo().TileLayout()
.Name("zoneWorkflow").Columns(1)
.Gap(g => g.Columns(8).Rows(8))
.Columns(1)
.Reorderable(true)
.Resizable(true)
.HtmlAttributes(new { Title = this.LocalResources("LegendeEtapes") })
.RowsHeight("auto"))
On the header template I added a button to remove tile with handle to
removeOperationBox(e) { // e is a KendoButton into Header tile
const itemId = e.sender.element.parents("div[role='listitem']").attr("id");
const workflow = $("#zoneWorkflow").data("kendoTileLayout");
const index = workflow.items.findIndex(i => i.id === itemId);
workflow.items.splice(index, 1);
}