Telerik Forums
UI for Blazor Forum
5 answers
1.4K+ views

Hi. 

I'm just wondering if there is a way to get a real-time chart like this. (or any other of the style)

I'm already made something "similar" with Telerik's charts. It is working but the component refresh does not look good. It redraws the series every time I add a new value. In my approach I tried using StateHasChanged () and Chart.Refresh () getting the same results.

Can you give me an idea of how to achieve that the series are not redrawn completely and only the last value is added in such a way we would obtain a smoother behavior?

Regards.
Ludwig.

Marin Bratanov
Telerik team
 answered on 31 Mar 2021
1 answer
331 views

Hello

 

Am trying to use this new component to get the browser size via below;

 

BlazorSizeKiller.razor

@foreach (var kv in MediaSizes)
{
    <TelerikMediaQuery Media="@(kv.Value)" OnChange="(() => UpdateCurrentSize(kv.Key))"></TelerikMediaQuery>
}

 

BlazorSizeKiller.razor.cs

public partial class BlazorSizeKiller
    {
        [Parameter] public int MaxScreenSize { get; set; } = 4000;
        [Parameter] public int MediaQuerySensitivity { get; set; } = 10;
        [Parameter] public int CurrentSize { get; set; }
        [Parameter] public EventCallback<int> CurrentSizeChanged { get; set; }
        readonly IDictionary<int, string> MediaSizes = new Dictionary<int, string>();


        protected override void OnParametersSet() => CreateList();

        private async Task UpdateCurrentSize(int media) => await CurrentSizeChanged.InvokeAsync(media);

        private void CreateList()
        {
            if (MediaSizes.Count == 0)
            {
                for (int i = 10; i < MaxScreenSize; i += MediaQuerySensitivity)
                {
                    MediaSizes.Add(i, "(max-width: " + i + "px)");
                }
            }
        }

    }

 

 

Is there a better way to do than this?

Or are there any problems with this method?

 

Cheers

Phil

 

Marin Bratanov
Telerik team
 answered on 31 Mar 2021
6 answers
623 views

After installing 2.23 into my Blazor WASM project, there's a js crash with the following stacktrace:

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Could not find 'TelerikBlazor.getLocationHost' ('getLocationHost' was undefined).
      Error: Could not find 'TelerikBlazor.getLocationHost' ('getLocationHost' was undefined).
          at https://localhost:44320/_framework/blazor.webassembly.js:1:1287
          at Array.forEach (<anonymous>)
          at e.findFunction (https://localhost:44320/_framework/blazor.webassembly.js:1:1247)
          at b (https://localhost:44320/_framework/blazor.webassembly.js:1:2989)
          at https://localhost:44320/_framework/blazor.webassembly.js:1:3935
          at new Promise (<anonymous>)
          at Object.beginInvokeJSFromDotNet (https://localhost:44320/_framework/blazor.webassembly.js:1:3908)
          at Object.w [as invokeJSFromDotNet] (https://localhost:44320/_framework/blazor.webassembly.js:1:64232)
          at _mono_wasm_invoke_js_blazor (https://localhost:44320/_framework/dotnet.5.0.4.js:1:190800)
          at do_icall (<anonymous>:wasm-function[10596]:0x194e4e)
Microsoft.JSInterop.JSException: Could not find 'TelerikBlazor.getLocationHost' ('getLocationHost' was undefined).
Error: Could not find 'TelerikBlazor.getLocationHost' ('getLocationHost' was undefined).
    at https://localhost:44320/_framework/blazor.webassembly.js:1:1287
    at Array.forEach (<anonymous>)
    at e.findFunction (https://localhost:44320/_framework/blazor.webassembly.js:1:1247)
    at b (https://localhost:44320/_framework/blazor.webassembly.js:1:2989)
    at https://localhost:44320/_framework/blazor.webassembly.js:1:3935
    at new Promise (<anonymous>)
    at Object.beginInvokeJSFromDotNet (https://localhost:44320/_framework/blazor.webassembly.js:1:3908)
    at Object.w [as invokeJSFromDotNet] (https://localhost:44320/_framework/blazor.webassembly.js:1:64232)
    at _mono_wasm_invoke_js_blazor (https://localhost:44320/_framework/dotnet.5.0.4.js:1:190800)
    at do_icall (<anonymous>:wasm-function[10596]:0x194e4e)
   at Microsoft.JSInterop.JSRuntime.<InvokeAsync>d__15`1[[System.String, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
   at Telerik.Blazor.Components.Dialog.DialogBuilder.OnAfterRenderAsync(Boolean firstRender)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)

 

Marin Bratanov
Telerik team
 answered on 31 Mar 2021
2 answers
446 views

An app needs to process data for the month - is there a way to use DatePicker and choose only the Month/Year ?? Displaying it is quite easy with Format.

Thanks

Drewanz
Top achievements
Rank 1
Veteran
 answered on 30 Mar 2021
1 answer
156 views

I have a question about the new Dialog component. Where should I ask it?

Thank you.

Marin Bratanov
Telerik team
 answered on 30 Mar 2021
1 answer
176 views

Is it possible to have a search function inside the dropdownlist?

I would like to be able to "type" the word I want to search.

so start typing and get a List.contains("string") like function

Marin Bratanov
Telerik team
 answered on 30 Mar 2021
6 answers
3.0K+ views

Hi 

I am the Upload Blazor component (2.17) in my web application.

I am using it in a cross-domain scenario. I have setup the headers to allow and respond as they should (I think :-) ). However, I am experience some problems.

I have read what has been written about CORS on the Upload component page and added code accordingly. My site and API runs in Azure, so I have adjusted the controller code listen on the page of the component, to work in Azure.

The issues I am facing are:

1. In the controller, I have added code to respond to the OPTIONS http verb. When I select a file to be uploaded, the OPTIONS method is called, the upload component states 'File failed to upload'. The http response from the API is 204 (NoContentResult). If I click on the retry icon, the upload component calls the actual upload method (post verb).

2. When the API receives the POST verb, the file is stored, and the API returns OkResult() (also tried with EmptyResult as some of your listings use that). However, the upload component write the error message 'File failed to upload' next to the file.

In both cases, the parm in the 'OnError' event handler, shows that http status is '0'. Telerik Fiddler shows that the API server has returned http status 204 and 200.

Do you have some idea why the component displayes 'File failed to upload' and how can I see what is wrong?

Luca
Top achievements
Rank 1
 answered on 30 Mar 2021
3 answers
477 views
Can the DatePicker allow copy and pasting of a date such as "7/31/2020"?
Svetoslav Dimitrov
Telerik team
 answered on 30 Mar 2021
3 answers
389 views

I have a use case where I need to write an SSRS report that is based off of the data displayed in a TelerikGrid. I obviously have a reference to the source data the the grid is displaying but if the user filters the grid and then wants to run the report I can't figure out how to get a reference to the filtered data the grid is displaying. Thinking I should be able to respond to the OnStateChanged event but I can't see how to get a reference to the IEnumerable from the GridStateEventArgs object which I would need to package up and send to my SSRS report. If I respond to OnRead I can get the data using the ToDataSourceResult extension method but then the default filtering doesn't work. I don't need to implement custom filtering so is there an easy way to get the data I need?

Marin Bratanov
Telerik team
 answered on 30 Mar 2021
4 answers
676 views
I have clients that want to set preferences on which columns in a grid they want visible/hidden when the app loads.  Is there a way to bind the checkbox values in a column chooser to a dataset?
Kristian
Telerik team
 answered on 29 Mar 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?