Telerik Forums
UI for Blazor Forum
8 answers
349 views

Hi,

We use the Kendo Calendar for a page on an internal site that i'm trying to update with Blazor.

The Kendo Calendar highlights multiple date that someone has booked, they can double-click to add/remove dates.

I don't seem to be able to accomplish this with the Blazor Calendar, I can pre-load existing dates fine, but if I select a new date the pre-loaded dates vanish. Do I need to reload dates on each click?

Also, will we get a double-click handler in the future?

<TelerikCalendar Date="@startDate"
                 Min="@min"
                 View="CalendarView.Month"
                 SelectionMode="@CalendarSelectionMode.Multiple"
                 SelectedDates="@selectedDates"
                 ValueChanged="@CalendarChangeHandler"
                 @ref="calendar">
</TelerikCalendar>
@code {
    DateTime startDate = DateTime.Today;
    DateTime min = DateTime.Today.AddDays(1);
    private List<DateTime> selectedDates { get; set; }
 
    private Telerik.Blazor.Components.TelerikCalendar calendar;
 
    protected override async Task OnInitializedAsync()
    {
        selectedDates = _timeOffFactory.GetDates();
    }
 
    private void CalendarChangeHandler(DateTime newDate)
    {
        selectedDates.Add(newDate);
    }
}
David Rhodes
Top achievements
Rank 1
 answered on 16 Oct 2019
6 answers
715 views

There are various "blocking ui" solutions and examples on the inter-web that allow you to block part or all of the UI while some longer-than-normal process takes place.  Eg.  a user clicks a button that has to load and process some data.

One example done with Angular is this
https://embed.plnkr.co/plunk/bNfRvD

How can we implement something similar with Blazor AND not resort to javascript interop?

Marin Bratanov
Telerik team
 answered on 14 Oct 2019
1 answer
1.2K+ views

Hi,

How do I add css to Telerik blazor widget markup?

Specifically, I am  interested in changing the back and fore color of the treeview.

Thanks … Ed

 

Marin Bratanov
Telerik team
 answered on 14 Oct 2019
1 answer
365 views

Good morning, we have acquired the Telerik package for Blazor and we have the following problem:
We have a project that uses Telerik + Inspinia, and by adding the script “<script src =" _ framework / blazor.server.js "> </script>”, inspinia stops working. Does not expand the side menu.

When removing the script, the side menu works but telerik does not:

By replacing the following in inspinia.js the side menu and telerik work:

But the submenu does not work, when you click it does not display the submenu:

Apparently Telerik Blazor is not compatible with Inspinia

Project attached.

Regards.

 

Marin Bratanov
Telerik team
 answered on 13 Oct 2019
3 answers
529 views

I have a date category x-axis which is currently auto fitting.
It is somewhat redundant however I was trying to add a title to the axis and I ran into issues.
Is that supported? I can easily add titles to a value axis.

Without the line "ChartCategoryAxisTitle" it works correctly however with no title.

Code:

<ChartCategoryAxes>
    <ChartCategoryAxis BaseUnit="ChartCategoryAxisBaseUnit.Fit" Type="ChartCategoryAxisType.Date" MaxDateGroups="10" />
    <ChartCategoryAxisTitle Text="Time" />
</ChartCategoryAxes>

 

Error:

blazor.server.js:15 [2019-10-10T18:39:17.853Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Blazor.Components.ChartCategoryAxisTitleBase.AddSelfToParent()
   at Telerik.Generated.Blazor.Components.ChildComponent.OnInitialized()
   at Telerik.Blazor.Components.ChartCategoryAxisTitleBase.OnInitialized()
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
Marin Bratanov
Telerik team
 answered on 13 Oct 2019
6 answers
2.6K+ views

When the TelerikButton component's fully qualified name isn't used I get an error. Examples of working and non-working code below:

This works:

@page "/teleriktest"

@using Telerik.Blazor.Components.TextBox

<TelerikTextBox Value="My text value"></TelerikTextBox>

<Telerik.Blazor.Components.Button.TelerikButton>My button</Telerik.Blazor.Components.Button.TelerikButton>

This does not work

@page "/teleriktest"

@using Telerik.Blazor.Components.TextBox

@using Telerik.Blazor.Components.Button

<TelerikTextBox Value="My text value"></TelerikTextBox>

<TelerikButton>My button</TelerikButton>

I get the error: 

Unhandled exception rendering component: Object of type 'TestProject.Pages.TelerikButton' does not have a property matching the name 'ChildContent'.

As you can see, doing something similar with the TelerikTextBox works fine, so I'm thinking it might not be me.

 

Marin Bratanov
Telerik team
 answered on 10 Oct 2019
1 answer
110 views

When setting menu items text with a variable the application fails with error.

var x = "XXX";

MenuItems.Add(new MenuItem()
            {
                Text = x,
                Path = "/test"
            });

 

 

error:

blazor.server.js:15 [2019-10-10T12:54:11.068Z] Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Blazor.Components.TelerikMenu`1.BuildRenderTree(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__6_0(RenderTreeBuilder builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()

Alberto
Top achievements
Rank 1
 answered on 10 Oct 2019
4 answers
1.7K+ views

It appears that ValueChanged isn't fired when the control is initialized. This is case if Value is populated, or it falls back to the first item from the data source.

Is this intentional? It's a bit of a pain having to specifically call it in OnInitialized, I expected it to be called automatically.

 

George
Top achievements
Rank 1
 answered on 09 Oct 2019
4 answers
452 views

I'm trying to see more than 1 level of hierarchy in my grid but i don't know how i would to such a thing with the current infrastructure.

 

any idea?

Marin Bratanov
Telerik team
 answered on 09 Oct 2019
1 answer
230 views

If the children property is not null then the expand children arrow will display.

It displays even if the children is an empty array.

This may be a feature but seems more like a bug to me.

<TelerikMenu Data="@MenuItems" Orientation="MenuOrientation.Vertical"
             UrlField="@nameof(MenuItem.Url)"                
             ItemsField="@nameof(MenuItem.Children)"
             TextField="@nameof(MenuItem.Text)"
             ImageUrlField="@nameof(MenuItem.Image)">
</TelerikMenu>

public class MenuItem
{
    public string Text { get; set; } = "";
    public string Url { get; set; } = "";
    public string Image { get; set; } = "";
    public MenuItem[] Children { get; set; } // Arrow will show on all items if: = Array.Empty<MenuItem>();
}
Marin Bratanov
Telerik team
 answered on 07 Oct 2019
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?