Hello. I'm having some trouble getting the new grid search panel to work. The example on the demos is pretty basic and doesn't have much info.
I can get the control to work if I specify which field to search ie: Search(s => { s.Fields("myField"); })
However, my datasource has datetime column and I get an exception when trying to seach all columns.
I get this error: The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.
Can you provide a sample or update the demo to include how to handle datetime fields?
Hello -
Kendo window closes when clicking anywhere outside the window .
Can this be prevented and make sure window closes only on close button(or any other specific button)
Thanks
Suresh
@(Html.Kendo().Window() .Name("loginWindow") //The name of the window is mandatory. It specifies the "id" attribute of the widget. .Title("Login") //set the title of the window .Content(@<text> @Html.Partial("_LoginPartial") </text>) .Draggable() //Enable dragging of the window .Width(300) .Height(350) .Modal(true) .Visible(false) )@model NTC.PropertySearch.Models.LoginModel@{ ViewBag.Title = "Log in";}<section id="loginWindow"> @using (Ajax.BeginForm("Login", "Account", new AjaxOptions { InsertionMode = InsertionMode.Replace, UpdateTargetId = "loginSection", })) { <div id="loginSection"> @ViewBag.Title <div > <p> @Html.DisplayFor(m => m.Message) </p> <p> @Html.DisplayFor(m => m.NumberOfLoginAttempts) </p> </div> <table> <tr> <td>@Html.LabelFor(m => m.UserName) </td> </tr> <tr> <td> @Html.TextBoxFor(m => m.UserName) </td> </tr> <tr> <td> @Html.ValidationMessageFor(m => m.UserName) </td> </tr> <tr> <td> @Html.LabelFor(m => m.Password) </td> </tr> <tr> <td> @Html.PasswordFor(m => m.Password) </td> </tr> <tr> <td> @Html.ValidationMessageFor(m => m.Password) </td> </tr> <tr> <td> @Html.CheckBoxFor(m => m.RememberMe) @Html.LabelFor(m => m.RememberMe, new { @class = "checkbox" }) </td> </tr> </table> <input type="submit" value="Log in" /> </div> }</section>:
public static class Extensions
{
public static List<FilterDescriptor> ToFilterDescriptor(this IList<IFilterDescriptor> filters)
{
var result = new List<FilterDescriptor>();
if (filters.Any())
{
foreach (var filter in filters)
{
var descriptor = filter as FilterDescriptor;
if (descriptor != null)
{
result.Add(descriptor);
}
else
{
var compositeFilterDescriptor= filter as CompositeFilterDescriptor;
if (compositeFilterDescriptor!= null)
{
result.AddRange(compositeFilterDescriptor.FilterDescriptors.ToFilterDescriptor());
}
}
}
}
return result;
}
}
In Use:
public ActionResult List([DataSourceRequest] DataSourceRequest request)
{
var departments= new List<int?>();
var nRequest = new DataSourceRequest
{
Groups = request.Groups,
Aggregates = request.Aggregates,
Page = request.Page,
PageSize = request.PageSize,
Sorts = request.Sorts,
Filters = new List<IFilterDescriptor>()
};
if (request.Filters.Any())
{
foreach (var fdc in request.Filters.ToFilterDescriptor())
{
switch (fdc.Member)
{
case "DepartmentId":
var department = Convert.ToInt32(fdc.Value);
departments.AddRange(db.StoredProcedureToTakeDepartmentsTree(department).Select(o => o.Id));
break;
default:
nRequest.Filters.Add(new FilterDescriptor
{
Member = fdc.Member,
MemberType = fdc.MemberType,
Operator = fdc.Operator,
Value = fdc.Value
});
break;
}
}
}
if (!departments.Any())
{
//departments = default departments if it's empty
}
var model = db.Students.Where(o => departments.Contains(o.DepartmentId))
.Select(o => new
{
o.Id
//Some columns
})
return Json(model.ToDataSourceResult(nRequest), JsonRequestBehavior.AllowGet);
}
I hope it helps...
Best Regards
Hi,
I have a requirement like in a single grid there are 3 header section with common column field.
In each header section user needs to add new row to give input and save.
Please let me know can we design the above requirement with kendo grid?
Thanks in advance.
Is there a difference between using "#=" and "#:" when blocking references in my column bindings? They both seem to work for me, and I wanted to make sure one isn't preferred over the other for certain situations. Thank you.
columns.Bound(prac => prac.PractitionerId).ClientTemplate("<input type='checkbox' name='chkPractitioner' value='#= PractitionerId #' onclick='handleProviderSelected(this,#= LocationId #)' />").Width(45).HeaderTemplate(" ");Hello All,
I was doing some searching and I can't find how to do a Hyperlink to a file on my local computer/share drive in HTML.Kendo().Menu()
This is my code
@(Html.Kendo().Menu()
.Name("Menu")
.Direction(MenuDirection.Left)
.Orientation(MenuOrientation.Vertical)
.Scrollable(true)
.Items(items =>
{
items.Add().Text("Phone List").Url("file:///C:\Users\D\Desktop/Phone.pdf");
items.Add().Text("Pager List");
})
I'm trying to make so when a user clicks on my "Phone List" menu item, it then opens up a PDF with the relevant information in a new browser tab. I know the link works, because I can click it and it opens up the pdf in a browser. Any help would be appreciated.
I have a partial view, that generates a chart, which I need to embed in a Grids client detail template, so a chart will be generated for each record in the grid.
It seems like it should work, but I can't pass the necessary id across to the controller of the partial view.
The client detail template is set up as:-
<script id="subdetailsTemplate" type="text/kendo-tmpl"> @(Html.Kendo().TabStrip().Name("Tabstrip_#=ReportKey#") .Items(i => { i.Add().Text("Activity Summaries").Selected(true).Content(@<text> @Html.Action("ReportCharts", "ServerChart", new { reportKey = "#=ReportKey#" }) </text>); i.Add().Text("Execution History").Selected(false).Content(@<text> @(Html.Kendo().Grid<SSRSStats.Models.View_ReportExecutions>() .Name("ELGrid_#=ReportKey#") .Columns(columns => { columns.Bound(o => o.LogEntryID).Title("ID"); columns.Bound(o => o.ExecutionLogID).Title("ID"); columns.Bound(o => o.UserName).Title("User"); columns.Bound(o => o.RequestType).Title("Request"); columns.Bound(o => o.TimeStart).Title("Time Start").Format("{0:g}"); columns.Bound(o => o.TimeEnd).Title("Time End").Format("{0:g}"); columns.Bound(o => o.TimeProcessing).Title("Processing").Format("{0:N0}"); columns.Bound(o => o.TimeDataRetrieval).Title("Data Retrieval").Format("{0:N0}"); columns.Bound(o => o.TimeRendering).Title("Rendering").Format("{0:N0}"); }) .ClientDetailTemplateId("subsubdetailsTemplate") .DataSource(dataSource => dataSource .Ajax() .PageSize(10) .Read(read => read.Action("RD_Executions", "ReportUsage", new { ReportKey = "#= ReportKey #" })) .Sort(s=>s.Add("LogEntryID").Descending()) ) .Pageable(p => p.Refresh(true)) .ToClientTemplate() ) </text>); }) .ToClientTemplate() )</script>--
This works fine without the @Html.Action, line, with the sub grid being populated correctly.
However, when this code is run, an error is thrown saying
The parameters dictionary contains a null entry for parameter 'reportKey' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult ReportCharts(Int32)'
The controller is:-
public ActionResult ReportCharts(int reportKey) { ViewBag.rk = reportKey; ViewBag.ChartName = "Chart_RK_" + reportKey.ToString(); ViewBag.ChartName2 = "Chart_RK2_" + reportKey.ToString(); ViewBag.ChartTitle = "Report Activity for the Last 10 Days"; ViewBag.ChartTitle2 = "Report Activity for the Last 12 Months"; //var query = _repository.GetLast10DaysUsage(ReportKey); return PartialView(); }--
If the parameter is made nullable, the page runs, but the charts do not display (although ajax calls are made to the server with the correct ReportKey value, as well as the default value).
What do I need to do in order to make this work?
I'm using version 2020.2.617
Thanks

First time working with this control and not sure what I'm missing.
Code:
@(Html.Kendo().SwitchFor(model => model.IsEnabled)
.Messages(c => c.Checked("Enabled").Unchecked("Disabled"))
)
The switch shows up and works, but the true and false message labels do not appear.
i try show my image instead of the image icon. i use view and template but dont view image
Views(v=>v.List(l=>l.TemplateId("template")))
<script type="text/x-kendo-tmpl" id="template">
<div class="product">
<img src="@Url.Content("~/content/web/foods/")#:ProductID#.jpg" alt="#:ProductName# image" />
</div>
</script>
