Telerik Forums
UI for Blazor Forum
1 answer
89 views

When setting menu items text with a variable the application fails with error.

var x = "XXX";

MenuItems.Add(new MenuItem()
            {
                Text = x,
                Path = "/test"
            });

 

 

error:

blazor.server.js:15 [2019-10-10T12:54:11.068Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Blazor.Components.TelerikMenu`1.BuildRenderTree(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__6_0(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

Alberto
Top achievements
Rank 1
 answered on 10 Oct 2019
4 answers
1.7K+ views

It appears that ValueChanged isn't fired when the control is initialized. This is case if Value is populated, or it falls back to the first item from the data source.

Is this intentional? It's a bit of a pain having to specifically call it in OnInitialized, I expected it to be called automatically.

 

George
Top achievements
Rank 1
 answered on 09 Oct 2019
4 answers
419 views

I'm trying to see more than 1 level of hierarchy in my grid but i don't know how i would to such a thing with the current infrastructure.

 

any idea?

Marin Bratanov
Telerik team
 answered on 09 Oct 2019
1 answer
209 views

If the children property is not null then the expand children arrow will display.

It displays even if the children is an empty array.

This may be a feature but seems more like a bug to me.

<TelerikMenu Data="@MenuItems" Orientation="MenuOrientation.Vertical"
             UrlField="@nameof(MenuItem.Url)"                
             ItemsField="@nameof(MenuItem.Children)"
             TextField="@nameof(MenuItem.Text)"
             ImageUrlField="@nameof(MenuItem.Image)">
</TelerikMenu>

public class MenuItem
{
    public string Text { get; set; } = "";
    public string Url { get; set; } = "";
    public string Image { get; set; } = "";
    public MenuItem[] Children { get; set; } // Arrow will show on all items if: = Array.Empty<MenuItem>();
}
Marin Bratanov
Telerik team
 answered on 07 Oct 2019
5 answers
1.9K+ views

Hi,

Is a PDf Viewer on the roadmap for the Blazor SDK?

If so will a thumbnail viewer be included?

 

Regards,

Graham

Marin Bratanov
Telerik team
 answered on 06 Oct 2019
1 answer
570 views

Hello, can you add support for the "title" attribute on the button component.    It has already been requested for Kendo for Angular 2+. We would like to have this feature in Blazor as well.  https://feedback.telerik.com/kendo-angular-ui/1360816-toolbar-button-title-attribute

Thanks,

Ryan

Marin Bratanov
Telerik team
 answered on 04 Oct 2019
3 answers
310 views

Will the Grid have an update to group within the code like what we can do in Asp.Net Core?

I have also noticed that we cannot hide columns, just not rendered.  I have hidden columns here to change the Grouping headers.

Example: (The grouping starts with line 19, which works in Asp.NET core)

01.@(Html.Kendo().Grid<Scenario>(Model.Scenarios)
02.                .Name("scenarios")
03.                .Columns(col =>
04.                {
05.                    col.Bound(c => c.Task.CodeYear).ClientGroupHeaderTemplate("Survey: #= data.value#").Hidden(true);
06.                    col.Bound(c => c.Task.Site.Alias).ClientGroupHeaderTemplate("Site: #= data.value#").Hidden(true);
07.                    col.Bound(c => c.ReferenceCode).ClientGroupHeaderTemplate("Scenario No: #= data.value#").Hidden(true);
08. 
09.                    col.Bound(c => c.Level).ClientTemplate("<a href='" + Url.Content($"/Foundation/Scenarios/Details?id=") + "#= ScenarioId#'><div data-toggle=\"popover\" title=\"#=Level.TypeName# \" data-content=\"#=Level.Description#\">#=Level.ShortName#<span class=\"glyphicon glyphicon-info-sign\"></span></div>").Width(100);
10. 
11.                    col.Bound(c => c.Risk).Width(150);
12. 
13.                    col.Bound(c => c.BusinessInterruption).Title("BI").ClientTemplate("#=BusinessInterruption# <a href=\"\\#\" data-toggle=\"popover\" title=\"#=BusinessInterruption#\" data-content=\"#=BIComments#\"><span class=\"glyphicon glyphicon-info-sign\"></span></a>");
14.                    col.Bound(c => c.Workaround).Title("Workaround").ClientTemplate("#=Workaround# <a href=\"\\#\" data-toggle=\"popover\" title=\"#=Workaround#\" data-content=\"#=WorkaroundComments#\"><span class=\"glyphicon glyphicon-info-sign\"></span></a>");
15.                    col.Bound(c => c.MaterialDamage).Title("Material Damage").ClientTemplate("#=MaterialDamage# <a href=\"\\#\" data-toggle=\"popover\" title=\"#=MaterialDamage#\" data-content=\"#=MaterialDamageComments#\"><span class=\"glyphicon glyphicon-info-sign\"></span></a>");
16.                })
17.                .DataSource(ds =>
18.                            ds.Ajax()
19.                            .Group(group =>
20.                            {
21.                                group.Add(g => g.Task.CodeYear);
22.                                group.Add(g => g.Task.Site.Alias);
23.                                group.Add(g => g.ReferenceCode);
24.                            })
25.                )
26.                .Scrollable()
27.            )
Marin Bratanov
Telerik team
 answered on 04 Oct 2019
1 answer
245 views

I am confused about your demos.  Why do you not use the Telerik Blazor components as much as possible.  For instance, if you look at the window demo, the only Telerik compenents I see is the TelerkWindow and items directly related to it.  For textboxes and labels, you go back to standard HTML instead of using the your equivalent.  Do they not play well together, or is there some other reason you don't use them?

I am asking as an honest question.  I am just now getting into this stuff and trying to figure out where I am going wrong when I run into problems is a pain.  For instance, This code ends up showing nothing.  When I inspect it, it is one the page with dimensions of 0x17.  I don't know if it is because of something I've done wrong with the WIndow, the textboxes, or if it is something else.

 

@page
@model LoginModel
<TelerikWindow Visible="True" Centered="true" Height="400" Width="400" >
  <WindowContent>
    <telerikTextBox Label="Username:"  />
    <br />
    <br />
    <telerikTextBox Label="Password:"  />
  </WindowContent>
</TelerikWindow>
 
@section Scripts {
    <partial name="_ValidationScriptsPartial" />
}
Marin Bratanov
Telerik team
 answered on 04 Oct 2019
4 answers
535 views

Hi,

I get this error when I try to filter a string readonly property:

Eccezione generata: 'System.InvalidOperationException' in Microsoft.EntityFrameworkCore.dll
Eccezione generata: 'System.InvalidOperationException' in System.Private.CoreLib.dll
Eccezione generata: 'System.InvalidOperationException' in System.Private.CoreLib.dll
Eccezione generata: 'System.InvalidOperationException' in System.Private.CoreLib.dll
Eccezione generata: 'System.InvalidOperationException' in System.Private.CoreLib.dll
Eccezione generata: 'System.InvalidOperationException' in Microsoft.AspNetCore.Components.dll
Eccezione generata: 'System.InvalidOperationException' in System.Private.CoreLib.dll
Eccezione generata: 'System.InvalidOperationException' in System.Private.CoreLib.dll
Eccezione generata: 'System.InvalidOperationException' in System.Private.CoreLib.dll
Eccezione generata: 'System.InvalidOperationException' in Microsoft.AspNetCore.Components.dll
Eccezione generata: 'System.InvalidOperationException' in System.Private.CoreLib.dll
Eccezione generata: 'System.InvalidOperationException' in System.Private.CoreLib.dll
Eccezione generata: 'System.InvalidOperationException' in System.Private.CoreLib.dll
Eccezione generata: 'System.InvalidOperationException' in System.Private.CoreLib.dll
Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'Dc6XDD5v9mxLyyypeL63oqa9jPGzD6bu1FJDHIMCCt4'.

System.InvalidOperationException: The LINQ expression 'Where<Card>(
    source: OrderByDescending<Card, Nullable<DateTime>>(
        source: Where<Card>(
            source: DbSet<Card>, 
            predicate: (c) => (Unhandled parameter: __pngruppo_0).Contains(c.IdAccessPoint) && c.Stato.Value == 1), 
        keySelector: (c) => c.DataInserimento), 
    predicate: (c) => c.Cognome.ToLower().Contains("t"))' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
   at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.<VisitMethodCall>g__CheckTranslated|8_0(ShapedQueryExpression translated, <>c__DisplayClass8_0& )
   at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
   at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass9_0`1.<Execute>b__0()
   at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQueryCore[TFunc](Object cacheKey, Func`1 compiler)
   at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)
   at Telerik.DataSource.Extensions.QueryableExtensions.Count(IQueryable source)
   at Telerik.DataSource.Extensions.QueryableExtensions.CreateDataSourceResult[TModel,TResult](IQueryable queryable, DataSourceRequest request, Func`2 selector)
   at Telerik.DataSource.Extensions.QueryableExtensions.ToDataSourceResult(IQueryable queryable, DataSourceRequest request)
   at Telerik.DataSource.Extensions.QueryableExtensions.<>c__DisplayClass3_0.<ToDataSourceResultAsync>b__0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
   at Bipoint.Data.Model.BipointService.GetCards_Inseriti_PN(DataSourceRequest request) in C:\Users\francesco\Documents\myprojects\2Next\Projects\Bipoint\prove\BipointB\Data\Model\BipointService.cs:line 31
   at Bipoint.Pages.Pn.ReadItems(GridReadEventArgs args) in C:\Users\francesco\Documents\myprojects\2Next\Projects\Bipoint\prove\BipointB\Pages\Pn.razor:line 62
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Telerik.Blazor.Components.TelerikGridBase`1.ProcessData()
   at Telerik.Blazor.Components.TelerikGridBase`1.OnFilterChange(FilterDescriptorBase filter)
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Telerik.Blazor.Components.Grid.GridFilterHeaderBase`1.Filter(FilterDescriptor filterDescriptor)
   at Telerik.Blazor.Components.Grid.GridFilterHeaderBase`1.OnValueChanged(Object newValue)
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_0(Object state)
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteSynchronously(TaskCompletionSource`1 completion, SendOrPostCallback d, Object state)
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c.<.cctor>b__23_0(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteBackground(WorkItem item)
Eccezione generata: 'System.InvalidOperationException' in Microsoft.AspNetCore.Components.Server.dll
Eccezione generata: 'System.InvalidOperationException' in Microsoft.JSInterop.dll
Eccezione generata: 'System.InvalidOperationException' in Microsoft.AspNetCore.Components.Server.dll
Eccezione generata: 'System.InvalidOperationException' in Microsoft.JSInterop.dll
Eccezione generata: 'System.InvalidOperationException' in Microsoft.AspNetCore.Components.Server.dll
Eccezione generata: 'System.InvalidOperationException' in Microsoft.JSInterop.dll
Eccezione generata: 'System.InvalidOperationException' in Microsoft.AspNetCore.Components.Server.dll
Eccezione generata: 'System.InvalidOperationException' in Microsoft.JSInterop.dll
Microsoft.AspNetCore.Routing.EndpointMiddleware: Information: Executed endpoint '/_blazor'
Eccezione generata: 'System.InvalidOperationException' in Microsoft.AspNetCore.Components.Server.dll
Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request finished in 17300.942ms 101 
Eccezione generata: 'System.InvalidOperationException' in Microsoft.JSInterop.dll

 

this is the grid definition:

 

 <TelerikGrid Data="@Inseriti" Height="100%" Class="fill-height"
                         Pageable="true" Sortable="true" Groupable="true"
                         PageSize=25 TotalCount="@Total"
                         OnRead=@ReadItems
                         FilterMode="Telerik.Blazor.GridFilterMode.FilterRow">
                <GridColumns>
                    <GridColumn Field="@(nameof(Card.Numero))" Title="Barcode" />
                    <GridColumn Field="@(nameof(Card.Cognome))" Title="Cognome" Groupable="false"/>
                </GridColumns>
            </TelerikGrid>

 

the Card is a EF class:

 public partial class Card
    {

      public int IdCard { get; set; }
        public int IdPatient { get; set; }

 

Marin Bratanov
Telerik team
 answered on 03 Oct 2019
1 answer
265 views

Greetings!

I'm trying to replicate your docs' sidenav with a Treeview component.
I was trying to overwrite the category template via Treeview Templates, but i can only overwrite the item container, not the complete node.
My idea was to overwrite the root category node to alter the expand icon, ... your sidenav opens child nodes with a click on the root node.

Does anybody has an idea? ...

Niklas

Marin Bratanov
Telerik team
 answered on 02 Oct 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?