Telerik Forums
UI for Blazor Forum
1 answer
1.2K+ views

Hello

=====

Telerik EDIT: Please update to version 5.0.1 or scroll down to this post with a summary of the problem.

=====

I'm trying to use latest Telerik Blazor 4.4.0 with dotnet 8.0preview7

Everything is looking ok on Debug sidebut after building and publishing project to IIS I get an error from rendering any gauge chart (I tried Arc and Radial)

Debug:

IIS:

Log from DevTools

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: ConstructorContainsNullParameterNames, System.Collections.Generic.KeyValuePair`2[System.String,System.String]
System.NotSupportedException: ConstructorContainsNullParameterNames, System.Collections.Generic.KeyValuePair`2[System.String,System.String]
   at System.Text.Json.ThrowHelper.ThrowNotSupportedException_ConstructorContainsNullParameterNames(Type )
   at System.Text.Json.Serialization.Metadata.DefaultJsonTypeInfoResolver.PopulateParameterInfoValues(JsonTypeInfo )
   at System.Text.Json.Serialization.Metadata.DefaultJsonTypeInfoResolver.CreateTypeInfoCore(Type , JsonConverter , JsonSerializerOptions )
   at System.Text.Json.Serialization.Metadata.DefaultJsonTypeInfoResolver.CreateJsonTypeInfo(Type , JsonSerializerOptions )
   at System.Text.Json.Serialization.Metadata.DefaultJsonTypeInfoResolver.GetTypeInfo(Type , JsonSerializerOptions )
   at System.Text.Json.JsonSerializerOptions.GetTypeInfoNoCaching(Type )
   at System.Text.Json.JsonSerializerOptions.CachingContext.CreateCacheEntry(Type type, CachingContext context)
--- End of stack trace from previous location ---
   at System.Text.Json.JsonSerializerOptions.CachingContext.CacheEntry.GetResult()
   at System.Text.Json.JsonSerializerOptions.CachingContext.GetOrAddTypeInfo(Type , Boolean )
   at System.Text.Json.JsonSerializerOptions.GetTypeInfoInternal(Type , Boolean , Nullable`1 , Boolean , Boolean )
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo.Configure()
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo.<EnsureConfigured>g__ConfigureSynchronized|170_0()
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo.EnsureConfigured()
   at System.Text.Json.JsonSerializerOptions.GetTypeInfoInternal(Type , Boolean , Nullable`1 , Boolean , Boolean )
   at System.Text.Json.JsonSerializerOptions.GetTypeInfoForRootType(Type , Boolean )
   at System.Text.Json.JsonSerializerOptions.TryGetPolymorphicTypeInfoForRootType(Object , JsonTypeInfo& )
   at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1[[System.Object, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Serialize(Utf8JsonWriter , Object& , Object )
   at System.Text.Json.JsonSerializer.WriteString[Object](Object& , JsonTypeInfo`1 )
   at System.Text.Json.JsonSerializer.Serialize[Object](Object value, JsonSerializerOptions options)
   at Telerik.Blazor.Common.Serialization.DefaultJavaScriptSerializer.Serialize(Object value)
   at Telerik.Blazor.Common.Serialization.JavaScriptInitializer.Serialize(IDictionary`2 object)
   at Telerik.Blazor.Common.Serialization.JavaScriptInitializer.Serialize(IDictionary`2 object)
   at Telerik.Blazor.Common.Serialization.JavaScriptInitializer.Serialize(IDictionary`2 object)
   at Telerik.Blazor.Common.Serialization.JavaScriptInitializer.Serialize(IDictionary`2 object)
   at Telerik.Blazor.Common.Serialization.JavaScriptInitializer.Serialize(IDictionary`2 object)
   at Telerik.Generated.Blazor.Components.DataVizComponent.Serialize(IJavaScriptInitializer serializer)
   at Telerik.Generated.Blazor.Components.DataVizComponent.Serialize()
   at Telerik.Generated.Blazor.Components.DataVizComponent.InitOrUpdateWidget()
   at Telerik.Generated.Blazor.Components.DataVizComponent.OnAfterRender(Boolean firstRender)
   at Telerik.Blazor.Components.TelerikRadialGauge.OnAfterRender(Boolean firstRender)
   at Microsoft.AspNetCore.Components.ComponentBase.Microsoft.AspNetCore.Components.IHandleAfterRender.OnAfterRenderAsync()
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.NotifyRenderCompletedAsync()

 

Thanks for reply

Dimo
Telerik team
 updated answer on 21 Nov 2023
1 answer
4 views

Hi, i use Grid.AutoFitAllColumnsAsync() to resize column width based on column content.  

Now, this method resize also non resizable columns (Resizable="false")

I would like to apply autofit only on resizable columns, how to solve?

I would use AutoFitColumnsAsync() method but i need a generic way to apply it excluding non resizable columns.

There is a way to read from code the Resizable property of columns?

Claudio
Top achievements
Rank 2
Bronze
Iron
Iron
 answered on 01 Mar 2024
1 answer
5 views
My scenario is that I have a grid of User. 
a User has Roles. 

I have a column that I have used the <Template> to display a chip of each Role a User has. 


The FilterTemplate does not have a solution to filter this collection out of the box. 
Have you solved this or similar? Please share any helpful feedback here as I am blocked on this task. 

I would prefer not to filter on a concatenated string of the users roles, as if I click the filter checkbox 'Admin' it would show results for any role that had Admin in it's name. 

If you used the OnRead event, when did you apply your filter and how?  

Thanks so much for your feedback on how you've solved this for your use case. 
 
Nadezhda Tacheva
Telerik team
 answered on 01 Mar 2024
1 answer
5 views

Hi,

Is it possible to configure the date picker to only show the month and year?

Regards,

Omar

Hristian Stefanov
Telerik team
 answered on 01 Mar 2024
1 answer
4 views

Hello, 

 

I have a TelerikPanelBar and I am getting the content from the database.  the text from item.Text is a string, that includes HTML.  Instead of rendering the HTML, it is still just rendering it as a string, even though I am converting it to a Markup String/using Markdig.

 

How can I get the text to display as HTML, instead of a string?

Hristian Stefanov
Telerik team
 answered on 01 Mar 2024
1 answer
7 views

Hi,

The DatePicker gives a runtime error on Hybrid (does works on blazor server)

<TelerikDatePicker Value="@entity.OrderDate.Date" Format="dd-MM-yyyy" ValueChanged="@((DateTime d) => UpdateDateTimeOffsetField(d))" />

If i remove the datapicker tag, there is no problem. I suspect it has something to do with the hybrid stuff

Loaded 'C:\Program Files\dotnet\shared\Microsoft.NETCore.App\8.0.2\System.Collections.Immutable.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Base.ErrorHandler:HandleError: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.Exception: A Telerik component on the requested view requires a TelerikRootComponent to be added to the root of the MainLayout component of the app. Read more at: https://docs.telerik.com/blazor-ui/getting-started/what-you-need#project-configuration
   at Telerik.Blazor.Components.RootComponent.TelerikRootComponentFragment.OnInitializedAsync()

 

 

 

Dimo
Telerik team
 answered on 01 Mar 2024
1 answer
893 views

Hello,

I don't want to add any GridCommandButton into the Grid's Layout.

For example I have implemented a ribbon on my page and there I have a button "Add Entry". Is it possible to achieve the same functionality from that button I have mentioned as when the Add GridCommandButton with the attribute Command="Add" is added to the grid layout in the toolbar?

 

Best regards,

Cipri

Dimo
Telerik team
 updated answer on 01 Mar 2024
1 answer
3 views

When user click on the input field of DatePicker, it either select date, or month, or year, but we want to select whole date input field like it highlights/selects whole content on Tab key.

Tried  with the following code but still no luck.

<span @onfocusin="@FocusHandler">
    <TelerikDatePicker @bind-Value="@SelectedDate"
                       Min="@Min"
                       Max="@Max"
                       Format="MM/dd/yyyy"
                       DebounceDelay="@DebounceDelay"
                       ShowWeekNumbers="true"
                       @ref="@DateRef">
                       <DatePickerFormatPlaceholder Day="day" Month="month" Year="year" />
    </TelerikDatePicker>
    </span>

@code {
    private DateTime? SelectedDate { get; set; }
    private DateTime Max = new DateTime(2050, 12, 31);
    private DateTime Min = new DateTime(1950, 1, 1);
    private int DebounceDelay { get; set; } = 200;
    private TelerikDatePicker<DateTime?> DateRef { get; set; }
    private async Task FocusHandler()
    {
        await DateRef.FocusAsync();
    }
}

 

It gets selected on buttonclick though (code snippet below where it selects all content on button click) - 

<TelerikButton OnClick="@FocusHandler">Focus Date</TelerikButton>
    <TelerikDatePicker @bind-Value="@SelectedDate"
                       Min="@Min"
                       Max="@Max"
                       Format="MM/dd/yyyy"
                       DebounceDelay="@DebounceDelay"
                       ShowWeekNumbers="true"
                       @ref="@DateRef">
                       <DatePickerFormatPlaceholder Day="day" Month="month" Year="year" />
    </TelerikDatePicker> 
@code {
    private DateTime? SelectedDate { get; set; }
    private DateTime Max = new DateTime(2050, 12, 31);
    private DateTime Min = new DateTime(1950, 1, 1);
    private int DebounceDelay { get; set; } = 200;
    private TelerikDatePicker<DateTime?> DateRef { get; set; }
    private async Task FocusHandler()
    {
        await DateRef.FocusAsync();
    }
}

 

Any help would be appreciated! TIA.

-Neelima

Hristian Stefanov
Telerik team
 answered on 29 Feb 2024
1 answer
16 views

Hi.

I'm facing a embarassing problem about browser compatibility of DataGrid.

I want to load my data on demand when the user scroll. 

For that i have choosed a DataGrid and i have implemented a behavior like a "scroll infini" which authorize the user to moove his scrollbar anywhere in the grid.

Everything work but ... on Mozilla Firefox, the Grid work like a incremential grid and not a infinite scroll grid. Even if the code is exactly the same.

On this first screenshot you can see the scrollbar of the grid with Mozilla Firefox (which reduce when you scroll). 


On the second one screenshot, I am on Microsoft Edge (on the same page and same URL) but there the behavior is correct (the scroll bar is small and i can move it anywhere i want even if the data is not yet loaded). 

The DataGrid work well with browser that use Chromium kernel (Microsoft Edge, Opera and Chromium for example).

Do you have any idea ?

Thanks.

 

Best regards,

Yanis.

Yanis
Top achievements
Rank 1
Iron
 answered on 29 Feb 2024
1 answer
7 views

Hi,

 

is there a way to add a closing delay or a safe triangle to a context menu like shown here? Building like it's 1984: A comprehensive guide to creating intuitive context menus - Height

 

Kind regards

Svetoslav Dimitrov
Telerik team
 answered on 29 Feb 2024
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?