Telerik Forums
UI for Blazor Forum
1 answer
162 views

When using the new MediaQuery, I am receiving an error on the iPad (Safari) but works fine with desktop and Android. Safari does not have support for addEventListener.

 

warn: Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer[100]
      Unhandled exception rendering component: this.mediaQueryList.addEventListener is not a function. (In 'th
is.mediaQueryList.addEventListener("change",this.onMediaChange)', 'this.mediaQueryList.addEventListener' is un
defined)
value@https://localhost:5001/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:59:14905
e@https://localhost:5001/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:59:14611
r@https://localhost:5001/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:1:13840
r@https://localhost:5001/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:59:12983

-------------------------------------------------------

I've implemented a rather ugly workaround for now but this should be resolved within Telerik itself.

Add this above <script src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js" defer></script>:

<script>
        var mediaObj = window.matchMedia("");
        if (typeof mediaObj.addEventListener != "function") {
           mediaObj.__proto__.addEventListener = function(event, listener) {
               mediaObj.addListener(listener);
           }
        }
 </script>

 

Svetoslav Dimitrov
Telerik team
 answered on 16 Apr 2021
4 answers
523 views

Hi,

 

After 2.21.0 update, I noticed there is still a dependency of Newtonsoft.Json package in Telerik.DataSource, increasing the application payload with > 600k. Since .Net 5 moved to System.Text.Json context, maybe that dependency could be eliminated.

 

Thanks,

Ion

Marin Bratanov
Telerik team
 answered on 16 Apr 2021
2 answers
2.4K+ views

I have the following scenario:

- file download from a site;

- process records on file to store in a database.

The first take about 4 seconds and the second around a minute or a little more.

Followed the sample of ProgressBar to signal that records are being processed, however, the UI is not being updated. 

The environment is Blazor with .NET 5.04 and the latest version of UI for Blazor

Below is the Razor component where the data is handled.

Any suggestions on how to update the UI and reflect the current status?

Thanks

 

@page "/importPeers"
@using DataLoader.Models
@using DataLoader.Services
@using System.Timers
@implements IDisposable
@inject LoadDataFIService service

<h1>CVM FI Download</h1>

<p>componente para realizar o download de informações da CVM e carga no banco de dados</p>
<hr />
<br />

<div class="row">
    <div class="col-sm-8 col-md-8">
        <div class="row">
            <div class="col-sm-6 col-md-6">
                <span>
                    Mês Referência:
                    <TelerikDatePicker @bind-Value="@selectedDate"
                                       BottomView="@CalendarView.Year"
                                       Format="MMM yyyy">
                    </TelerikDatePicker>
                </span>
            </div>
            <div class="col-sm-3 col-md-3">
                <TelerikButton OnClick="@OnProcessDataClick">Processar</TelerikButton>
            </div>
        </div>
    </div>
</div>
<br />
<div class="row">
    <div class="col-sm-8 col-md-8">
        @processingAction
        <br />
        <TelerikProgressBar Indeterminate="@isIndeterminate" Value="@CurrentValue" Max="@MaxValue" />
    </div>
</div>
@currentCount importados...
<hr />




@code {
    public string processingAction { get; set; }
    public bool isIndeterminate { get; set; } = false;
    public int progressValue { get; set; } = 0;
    DateTime selectedDate { get; set; } = DateTime.Now;
    int currentCount = 0;
    public double MaxValue { get; set; } = 100;
    public double CurrentValue { get; set; } = 0;
    public double StepValue { get; set; } = 5;
    public Timer Clock { get; set; } = new Timer();

    void OnProcessDataClick()
    {
        currentCount++;
        ProcessData();

    }

    void ProcessData()
    {
        //signal progress bar for download
        processingAction = "Downloading...";
        MaxValue = 5 * 1000;                    // download should take no more than 4 seconds
        StartProgress();

        var result = service.DownloadFile(selectedDate);

        // signal end of downloading
        processingAction = "Downloaded!";
        StopProgress();

        System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch();

        if (result)
        {
            processingAction = "Processing records...";
            MaxValue = 65 * 1000;       // data processing should last about a minute or more
            StartProgress();
            //watch.Start();

            currentCount = service.ReadCsvFile(selectedDate);

            //watch.Stop();
            processingAction = "Records processed!";
            StopProgress();
        }

        // Console.WriteLine(watch.Elapsed);
    }

    public void Dispose()
    {
        StopProgress();
        Clock?.Close();
    }

    public void StartProgress(int interval = 200)
    {
        if (Clock?.Enabled == false)
        {
            Clock.Interval = interval;
            Clock.Elapsed -= OnClockElapsedEvent;
            Clock.Elapsed += OnClockElapsedEvent;
            Clock.AutoReset = true;
            Clock.Start();
        }
    }

    public void OnClockElapsedEvent(Object source, ElapsedEventArgs e)
    {
        if (CurrentValue < MaxValue)
        {
            UpdateProgress();
        }
        else
        {
            StopProgress();
        }
    }

    public void UpdateProgress()
    {
        CurrentValue += StepValue;
        InvokeAsync(StateHasChanged);
    }

    public void StopProgress()
    {
        Clock?.Stop();
        InvokeAsync(StateHasChanged);
    }

}

Drewanz
Top achievements
Rank 1
Veteran
 answered on 16 Apr 2021
6 answers
2.0K+ views

Hi,

When I set grid in InCell edit mode, I have to click on grid cell, so the textbox control for edit becomes available. Can I set it active/available for edit once grid is loaded and avoid clicking on the cell?

Current scenario:

1. Grid is loaded

2. Click on the cell I want to edit

3. Text box is shown with the value for edit

4. On focus lost the updated value is shown in the cell and text box is gone

 

Desired scenario:

1. Grid is loaded
2. No need to click on any cell, all available cells for edit are showing text boxes with the value for update
3. Update desired values in the grid cells text box
4. On focus lost the updated value is shown in the cell and text box is gone

 

Thanks,

Max

Maksym
Top achievements
Rank 1
 answered on 15 Apr 2021
2 answers
416 views
My toasts are shown but behind the elements on the screen. How do I fix this?
DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 15 Apr 2021
9 answers
905 views
I've used the Elastic Design example to change the font size of the grid, however, font size for Incell Editing appears to revert to standard size.  I'm assuming there are some further style settings that can be set to get Incell Editing to match the Grid Font size?
Fairoz
Top achievements
Rank 1
 answered on 15 Apr 2021
1 answer
713 views

 I have a context menu being opened by right clicking on a row in my grid.  

One of the sections is "Delete Item" which when clicked on shows a Dialog Confirm window.

The problem I am having is the Confirm window is showing, but the context menu does not close (go away) so both items show on the screen (and sometimes overlap).

Is there a way I can manually close the context window when an items is clicked on?

Marin Bratanov
Telerik team
 answered on 15 Apr 2021
2 answers
988 views

Is there any way to make the icon appear to right of the text instead of the left?

I have tried messing with css to get this work, but as of now, have not had much luck.

Would be nice if there was an IconPosition Setting on the button.

Hristian Stefanov
Telerik team
 answered on 14 Apr 2021
1 answer
521 views

Hi,

 

I have to bind dropdown list in popup from Telerik grid when you click on edit. Now i wanted to get the selected value from grid.

Please help me out on this issue.

Thank you.

Svetoslav Dimitrov
Telerik team
 answered on 14 Apr 2021
3 answers
1.2K+ views

Is there a way to make the TelerikGrid not Width 100% as on mobile devices it looks very small, I would like it to be scrollable and show the entire header texts

 

Svetoslav Dimitrov
Telerik team
 answered on 14 Apr 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?