Telerik Forums
UI for Blazor Forum
2 answers
1.0K+ views

Have a need that might be able to handle it with a Treeview.  Need to allow a user to edit a few nodes of a json file, then save the changes.

treeview demo

Found this javascript-based example of editing json in the browser.  Probably more features than I need.
https://github.com/josdejong/jsoneditor

If nothing else, I think with the Blazor Treeview as-is, could I use the following approach?

- Load json data into the tree structure
- Place a single input field somewhere near the tree (eg. at the top)
- Use a template of some sort that includes an "onclick" event
- The onclick event loads the item text or value into the input field for editing
- Provide a "save changes" button that takes current values of the data in the tree, serializes back to json and saves over the top of the file.

Sound reasonable?

Marin Bratanov
Telerik team
 answered on 17 Oct 2019
8 answers
277 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
588 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
289 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
432 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.3K+ 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
66 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.5K+ 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
308 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?