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);
}
Hello,
I'm using a Grid control with virtual scrolling. When I export to PDF, the content runs right off of the bottom of the page without breaking to a new page.
I have my datasource's page size set to 100 records to limit the number of times the grid will need to fetch new data from the server. If I change this to only 5 records, for example, then the PDF will create a page break after 5 records. However, I am also using grouping on the data. If every row is in its own group, I can get about 6 or 7 rows onto a page. If every row falls under the same group, I can get about 13-15 rows onto a page. Because the number of rows per page may vary, I can't resort to setting the page size on the datasource.
My main concern at the moment is getting automatic page breaking to work. In the screenshot I've attached, you can see that there is still some data at the very bottom of the page that is cut off. There should be 11 rows of data, across 6 groups, but only 9 rows manage to fit onto the page. Relevant code below:
.Pdf(pdf => pdf
.FileName("BidAwards.pdf")
.AllPages()
.PaperSize("A4")
.Landscape()
.AvoidLinks()
)
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(100)
.Events(events => events.Error("error_handler"))
.Model(model => model.Id(col => col.BidId))
.Read(read => read.Action("BidAwardGridData", "Reports", Model))
.Group(groups => groups.Add(col => col.GroupValue))
)
I'd also like to find a way to keep entire groups of rows on a page if possible. In other words, if the whole group won't fit on the remainder of the page, break to a new page for that group.
Unfortunately, for the time being I'm stuck on an older version of the Telerik controls, and can't easily update until after this development cycle is completed (unless it's necessary to fix this).
Thanks!!!