Telerik Forums
UI for Blazor Forum
1 answer
171 views

Hello, I apologize for my poor English.

 

I'm trying to develop the stock chart. The categories of all stock charts in the demo are date format, but what I want is int format.

I'd like to make the weekly count a chart. Therefore, my category data is a number from 1 to 53.

The current page is as follow.

Data represented as 09:00:00.fff is actually a number between 1 and 53.

Also, I would like to express the valueaxis expressed in {$0.0} as an integer.

 

How can I use the int type in category data?

Nadezhda Tacheva
Telerik team
 answered on 17 Dec 2021
1 answer
140 views

As per subject, we need to use the StockChartNavigator but we don't want to use StockChart.

We basically just want to have that kind of component to be able to select a range between dates.

We could even fit it with a simple data serie if it's needed, but we don't want to use it within a stock chart

 

Is it possible?

 

An alternative is the RangeSlider but we'd prefer the graphical aspect of the StockChartNavigat and in case use it binding its range to display  non-stock charts

 

Thanks

Nadezhda Tacheva
Telerik team
 answered on 17 Dec 2021
1 answer
271 views

Our pipelines are failing:

 

The nuget command failed with exit code(1) and error(Failed to retrieve information about 'Telerik.UI.for.Blazor' from remote source 'https://nuget.telerik.com/v3/package/telerik.ui.for.blazor/index.json'. The HTTP request to 'GET https://nuget.telerik.com/v3/package/telerik.ui.for.blazor/index.json' has timed out after 100000ms.

Apostolos
Telerik team
 answered on 17 Dec 2021
1 answer
238 views

Hi.

 

Trying to use virtualization in the Combobox with a remote data source, but the DataSourceRequest.Page in OnRead is always 0.
How to fix that?

Hristian Stefanov
Telerik team
 answered on 17 Dec 2021
1 answer
802 views

Hi

I have a question about the Upload Component. Is it possible to Upload without using a controller? I have a referenced dll that can handle the Data and pass also the Files directly, without going through a controller?!

 

Is there a way to achieve this?

 

Thanks in Advance

Best Regards

Besir

Marin Bratanov
Telerik team
 answered on 16 Dec 2021
1 answer
615 views

Hi,

is it posssible to add an image or razor component to each of the DropDown or ComboBox list items? 

And if so how?

Thanks.

Marin Bratanov
Telerik team
 answered on 16 Dec 2021
0 answers
251 views

I am using latest, edge, chrome and firefox

If I enable navigation in the grid, page up/down stops to work.

I can navigate the cells with the arrows keys, but unable to move up / down page by page.

So for now I have disabled navigation.

 

Martin Herløv
Top achievements
Rank 2
Bronze
Iron
Iron
 asked on 16 Dec 2021
1 answer
521 views

I can't find a 'k' class to make my TelerikButton look like the Bootstrap "danger" button. And if I use 'btn btn-danger' for the Class property of my TelerikButton that doesnt work either.

Is there a "k" class to do this or do I need to clear out the built in TelerikButton style somehow and write my own?

Svetoslav Dimitrov
Telerik team
 answered on 16 Dec 2021
1 answer
1.8K+ views

Hi, I try tu use the new Date/TimeOnly types of .Net6 and they are not supported by the Telerik components (you cannot bind them to these types). I tested it on the 2.30.0 version you just released.

It works fine with the Blazor Components (InputDate, input type="time"...) but it is not a practical solution for component like TelerikGrid (it would mean templating everything, breaking the inline validation etc.) or TelerikScheduler/Gantt (I would like to use a DateOnly for its Date property for example, and ideally its model could be a DateOnly and 2 TimeOnly instead of 2 DateTime but that's less important).

 

Do you have an ETA for their support or a workaround?

Also, is there documentation about the limitations of your .Net6 support so I don't have other bad surprises?

Svetoslav Dimitrov
Telerik team
 answered on 14 Dec 2021
0 answers
463 views

Hi I have made a utility class for helping with state management


<TelerikButton OnClick="@_gridStateManager.SaveState" Icon="download">Save State</TelerikButton>
<TelerikButton OnClick="@_gridStateManager.LoadState" Icon="upload">Load State</TelerikButton>
<TelerikButton OnClick="@_gridStateManager.ResetState" Icon="reset">Reset State</TelerikButton>

In the code behind file


 protected override async Task OnInitializedAsync()
{
     _gridStateManager = new GridStateManager<PortfolioListItem>(LocalStorage, PortfolioListGrid, GetDefaultGridState);
}

The problem is that the GridStateManger gets a null reference to the grid.

I know that the @ref is only safe to get in OnAfterRender / Async. How can I initialize the GridStateManager with the @ref set and also make it possible for the grid to call :


OnStateInit="@((GridStateEventArgs<PortfolioListItem> args) => _gridStateManager.OnStateInitHandler(args))">

In a safe way?

This is the code for my GridStateManager


using System;
using System.Threading.Tasks;
using Blazored.LocalStorage;
using Telerik.Blazor.Components;

namespace Argus.Client;

public class GridStateManager<T> where T : class
{
    private readonly ILocalStorageService _localStorage;
    private readonly TelerikGrid<T> _grid;
    private readonly Func<GridState<T>> _getDefaultGridState;
    private readonly string _stateStorageKey;

    public GridStateManager(
        ILocalStorageService localStorage,
        TelerikGrid<T> grid,
        Func<GridState<T>> getDefaultGridState)
    {
        _localStorage = localStorage;
        _grid = grid;
        _getDefaultGridState = getDefaultGridState;
        _stateStorageKey = $"GridStateFor{nameof(T)}";
    }

    public async Task OnStateInitHandler(GridStateEventArgs<T> args)
    {
        try
        {
            var storageState = await _localStorage.GetItemAsync<GridState<T>>(_stateStorageKey);
            if (storageState != null)
                args.GridState = storageState;
            if (storageState == null && _getDefaultGridState != null)
                args.GridState = _getDefaultGridState();
        }
        catch (Exception e)
        {
            Console.WriteLine(e);
        }
    }

    public async Task SaveState()
    {
        var gridState = _grid.GetState();
        await _localStorage.SetItemAsync(_stateStorageKey, gridState);
    }

    public async Task LoadState()
    {
        GridState<T> storedState = await _localStorage.GetItemAsync<GridState<T>>(_stateStorageKey);
        if (storedState != null)
        {
            await _grid.SetState(storedState);
        }
    }

    public async void ResetState()
    {
        if (_getDefaultGridState != null)
        {
            await _grid.SetState(_getDefaultGridState());
        }
        await _localStorage.RemoveItemAsync(_stateStorageKey);
    }
}


If I could get the grid reference in the OnStateInit  EventCallBack then I would have solved the problem

OnStateInit="@((GridStateEventArgs<PortfolioListItem> args) => _gridStateManager.OnStateInitHandler(args, @gridRef))">

 

I then tried to create the GridStateManger in the OnStateInit call from the grid. But I still don't have a valid ref to the grid, why?


OnStateInit="@((GridStateEventArgs<PortfolioListItem> args) => InitGridStateManager(args))">


private async Task InitGridStateManager(GridStateEventArgs<PortfolioListItem> args)
{
       _gridStateManager = new GridStateManager<PortfolioListItem>(LocalStorage, PortfolioListGrid, GetDefaultGridState);
       await _gridStateManager.OnStateInitHandler(args);
 }

 

Martin Herløv
Top achievements
Rank 2
Bronze
Iron
Iron
 updated question on 13 Dec 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?