Im getting this error whenever I try to add the Kendo grid into my project. I am using asp .netcore8 razor pages. I have followed the tutorials on how to install Telerik and thought I did so correctly. The working example directly from a Telerik tutorial project doesnt work in mine and produces this error, and I have all of the same Nuget packages, etc. The only difference is I have my setup in the Startup.cs file rather than Program.cs?
Ive attached my files.
Thanks!
Hello,
I need to display multiple ExpansionPanels with nested TreeViews, however I don't find examples of this, and this code is failing with exception:
@(Html.Kendo().ExpansionPanel()
.Title(group.Text)
.Content(@<text>
@(Html.Kendo().TreeView()
.Name("tree" + group.Id)
.CheckboxTemplateId("checkbox-template")
.Checkboxes(true)
.BindTo(group.Items))
</text>)
)
Fails with:
fail: Microsoft.AspNetCore.Server.Kestrel[13]
Connection id "0HN9NPOSEKJS4", Request id "0HN9NPOSEKJS4:00000002": An unhandled exception was thrown by the application.
System.NullReferenceException: Object reference not set to an instance of an object.
at Kendo.Mvc.UI.WidgetBase.VerifySettings()
at Kendo.Mvc.UI.WidgetBase.WriteHtml(TextWriter writer)
at Kendo.Mvc.UI.ExpansionPanel.WriteHtml(TextWriter writer)
at Kendo.Mvc.UI.WidgetBase.RenderHtml(TextWriter writer)
at Kendo.Mvc.UI.WidgetBase.ToHtmlString()
at Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.ToHtmlString()
at Kendo.Mvc.UI.Fluent.WidgetBuilderBase`2.WriteTo(TextWriter writer, HtmlEncoder encoder)
at Microsoft.AspNetCore.Mvc.ViewFeatures.Buffers.ViewBuffer.WriteToAsync(TextWriter writer, HtmlEncoder encoder)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable`1 statusCode)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)
at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
at Microsoft.WebTools.BrowserLink.Net.BrowserLinkMiddleware.InvokeAsync(HttpContext context)
at Microsoft.AspNetCore.Watch.BrowserRefresh.BrowserRefreshMiddleware.InvokeAsync(HttpContext context)
at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
Treeview works in itself and if I wrap it in ExpansionPanel raw HTML.
Is there anyway around it?
Thank you.
Hi,
the following template is partially working when used in a grid-row-template.
<grid-row-template>
<div>${data.Name}</div>
#if(data.HasLastName){#
<div>${data.LastName}</div>
#} else {#
<div>some other stuff</div>
#}#
</grid-row-template>
values inside ${ } are properly replaced, however the code inside # # is not executed, it is rendered as text.
What is the proper way to include conditionals in this case?
regards
I need to be able to render a tabstrip with a dynamic number of tabs, and then within each tab a griid to display records that relate to the tab.
Basically it is grouping sets of data into tabs, and then displaying the records from that group in the grid.
The underlying source of the grids is all the same, albeit each one would be showing a different subset of records.
The number of tabs/grids required would be unknown until the data is loaded.
Is this even possible? I have searched but can't find an example doing exactly what I need.
Thanks
Hi,
How to save the layout of the dockmanager ? I need to restore panels in the right place.
Best regards
I can't seem to get the Cascading DropdownList functionality to return the selected value from the parent. I will list what I have and if someone can point out my problem I would appreciate it. The parent loads the selected items correctly, and it calls the child dropdownlist event when a new select is made, but the parameter that should have the selected id is always null.
.cshtml page
<table><tr>
<td>CLIN:</td>
<td>
<kendo-dropdownlist name="ddlCLIN" datatextfield="Title" datavaluefield="ProjectID" >
<datasource type="DataSourceTagHelperType.Custom">
<transport>
<read url="/LogEditor?handler=CLINS" />
</transport>
</datasource>
</kendo-dropdownlist>
</td>
</tr>
<tr>
<td>CLIN Task Type:</td>
<td>
<kendo-dropdownlist name="ddlCLINTaskType" cascade-from="ddlCLIN" datatextfield="Title" datavaluefield="ProjectID">
<datasource type="DataSourceTagHelperType.Custom">
<transport>
<read url="/LogEditor?handler=CLINTaskTypes" />
</transport>
</datasource>
</kendo-dropdownlist>
</td>
</tr></table>
html.cs
public JsonResult OnGetCLINTaskTypes(int? ddlCLIN)
Hi
I have a data bound menu component where I would like to override the styles of individual items - namely at the moment I would like to make some bold.
What I actually want to do is to render a separator, then a bold header, and then a normal weight list of options - something like :
-----------------------------
Recent Customers
Customer 1
Customer 2
Customer 3
-----------------------------
I do not want them to be a sub menu ideally. I am struggling to work out how to set the class/style of individual menu items.
This is my code for rendering the menu currently, I will add another property to item/subitem as a flag to denote requiring to be bold :
@(
Html.Kendo().Menu()
.Name("mainMenu")
.BindTo(Model.Menus.Where(s => s.ParentMenuId == 0), mappings =>
{
mappings.For<Welcomm_CRM.Core.Application.Menu>(binding => binding // Define the first level of the Menu.
.ItemDataBound((item, type) => // Define the mapping between the Menu item properties and the model properties.
{
item.Text = type.MenuTitle;
if (type.MenuSource == 999999)
{
item.LinkHtmlAttributes.Add(type.ControllerName, type.ActionName);
}
else if (type.MenuSource == 999998)
{
item.Separator = true;
}
else if (type.MenuSource == 0)
{
item.Url = @Html.Encode(type.Url);
}
}
)
.Children(type => Model.Menus.Where(s => s.ParentMenuId == type.MenuId)));
mappings.For<Welcomm_CRM.Core.Application.Menu>(binding => binding
.ItemDataBound((item, subtype) =>
{
item.Text = subtype.MenuTitle;
if (subtype.MenuSource == 999999)
{
item.LinkHtmlAttributes.Add(subtype.ControllerName, subtype.ActionName);
}
else if (subtype.MenuSource == 999998)
{
item.Separator = true;
}
else
{
item.Url = @Html.Encode(subtype.Url);
}
})
);
})
)