Telerik Forums
UI for Blazor Forum
11 answers
3.5K+ views
Can I hide vertical scroll bar?
In this example scroll bar present but absolutely unusable https://demos.telerik.com/blazor-ui/grid/custom-editor
Thank you.
Flemming
Top achievements
Rank 1
Veteran
 answered on 19 Apr 2021
3 answers
120 views

Hello,


I have an issue that I'd like to share with you.
I have the following setup:
Razor:
@if (_isEditMode && _aListOfStrings.Any())
{
<TelerikAutoComplete Data="_aListOfStrings"
Filterable="true"
FilterOperator="StringFilterOperator.Contains"
@bind-Value="_aViewModel.aStringProperty">
</TelerikAutoComplete>
}


Code behind:
protected override async Task OnParametersSetAsync()
{
await GetTheStringList();
}


private async Task GetTheStringList ()
{
_aListOfStrings = _aService.GetTheListOfStrings();
}

 

The autocomplete renders like expected. The data is also shown and filtered like expected. For some reason, when I type a string that is present in "_aListOfStrings" and select it for the first time. The string is not filled-in the autocomplete, nor does it get bound to the model. The second time I filter and select the string, it does get filled in and bound to the model.
Do you guys have any idea why this happens? I can't seem to figure it out. This is happening for all autocompletes in this "form". I've tried the following:
1. Render the Autocomplete outside of the Form
2. Set an id
3. Call this.StateHasChanged() after retrieving the data for the list
4. Changed OnParametersSetAsync() to OnInitilizedAsync() to fetch the list
Thanks in advance!

Hristian Stefanov
Telerik team
 answered on 19 Apr 2021
2 answers
987 views

First a salute to the Telerik team. The Grid is awesome, thanks for making me look like a rock star.

I am using the build in Blazor FileUpload component, not Telerik and would like to show validations errors in the pop-up form for not supported file types.

How can I show errors in a component like the Validation Summary?

 

Marin Bratanov
Telerik team
 answered on 16 Apr 2021
7 answers
449 views

I want negative #'s to show as -9999 not (9999). 

Is there any way to do this?  

I could do it with the Kendo controlsby putting kendo.culture().numberFormat.currency.pattern[0] = "-$n"; in the document.ready function but I can't see to figure out how to do it with Blazor controls.

Thanks.

Marin Bratanov
Telerik team
 answered on 16 Apr 2021
1 answer
149 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
496 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.3K+ 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
1.9K+ 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
406 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
888 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
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?