Telerik Forums
UI for Blazor Forum
1 answer
575 views

Hello,

I want to provide two modes for editing with the editor.

One full-featured editor with all tools (EditorToolSets.All) and one mode with none or only custom tools and I want to switch between the modes.

So I tried somethink likse this:


private List<IEditorTool> tools { get; set; } = new List<IEditorTool>();

protected override Task OnInitializedAsync()
{
    tools = EditorToolSets.All;
    tools.Add(new CustomTool("MyTool");
}
 
private void SwitchModel(MyMode mode)
{
    if (mode == MyMode.Full)
    {
        tools = EditorToolSets.All;
    }
   
    if (mode == MyMode.None)
    {
        tools = Clear;
    }
}
If I switch from MyMode.Full to MyMode.None, all tools disappers. But if I switched back, nothing happens. How can I get the tools back? :-)
Svetoslav Dimitrov
Telerik team
 answered on 17 Jan 2023
1 answer
137 views
Is it possible to use the DataSource library to create or update a record via an Odata Endpoint?
Any sample or example code?
Dimo
Telerik team
 answered on 16 Jan 2023
1 answer
107 views

Hi,

I have a TelerikEditor with additional custom tools:

In the razor-file:

<TelerikEditor @bind-Value="@myContent" Toosl="@tools">
    <EditorCustomTools> 
    @* Custom tools here *@
    </EditorCustomTools>
</TelerikEditor>

in the code behind file:


private List<IEditorTool> tools { get; set; } = new List<IEditorTool>();

protected override Task OnInitializedAsync()
{
    tools = EditorToolSets.All;
    tools.Add(new CustomTool("MyTools");
    return base.OnInitializedAsync();
}

At this point, all works as expected.

But when I navigate to another page in my wasm App and then navigate back to the page with the editor, the custom tools is renderd twice. If I navigate away and back to the page once more, the custom tool is now renderd three times. If I do it again: four times the custom tool ....

I tried:

tools = new();

as first line in OnInitializedAsync, but with the same result.

I think it is a rendering problem. I checked tools.Count at the beginning of OnInitializedAsync and it is alway 0.

Any suggestions? :-)

Svetoslav Dimitrov
Telerik team
 answered on 16 Jan 2023
0 answers
159 views

Hi,

I have set up my model the exact way it is in the demo. My client makes a JSON call to API to populate the scheduler. The post is successful but the get seems to break the scheduler. The error message is below:

Error: System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Collections.Generic.IEnumerable`1[System.DateTime]'. at Telerik.Blazor.Components.TelerikScheduler`1.CreateAppointment(TItem dataItem) at Telerik.Blazor.Components.TelerikScheduler`1.ExpandAppointments() at Telerik.Blazor.Components.TelerikScheduler`1.ProcessAppointmentsAsync() at Telerik.Blazor.Components.TelerikScheduler`1.OnParametersSetAsync() at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task) at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)

 

unsure why I need to cast as the demo it seems to work fine without casting. Is this an issue within the UI control itself?

I'm using version 2.24.0

Thanks

Blair
Top achievements
Rank 1
 asked on 14 Jan 2023
1 answer
119 views

Say I have a report with 13 month column names.

Depending on the date range given to report the columns names could be different.

How do I build the resulting class to hold the data for the gird in this case?

 public class MgtRtp2Result
        {
            public string? TN { get; set; }
            public string? BAN { get; set; }
            public string? Platform { get; set; }

            [DisplayFormat(DataFormatString = "{0:C}")]
            public decimal Col1Amt { get; set; }

            [DisplayFormat(DataFormatString = "{0:C}")]
            public decimal Col2Amt { get; set; }

      }

Col1Amt name in the SQL result coming back could be May2022 for first run but Jun2022 for next run.

Same thing can happen Col2Amt.

Thanks for the help.

Deasun
Top achievements
Rank 3
Bronze
Bronze
Bronze
 answered on 13 Jan 2023
1 answer
101 views

I am having an issue with this control.

When testing it I init it from the OnInitialized section and it worked fine.

But in production app It does not get init until after a DDL on the page is chosen from by user.

In this case I keep getting NO Data displayed on the drop down part.

Take the same code and put in the OnInitialized section and the controll is filled in.

How can I get it to work after the ddl is chosen?

 

Thanks

Deasun.

Deasun
Top achievements
Rank 3
Bronze
Bronze
Bronze
 answered on 13 Jan 2023
1 answer
134 views

I have a SP I call that takes 1 or 2 minutes to run.

I am running into the error:

system threading taskcanceledexception a task was canceled

atm the SP takes 1:08 to run.

At 35 seconds, using filters to get less data back, it runs fine!

We have many reports that take a bit to run.

How to I get this task thing to stop killing my app.

 

Deasun
Top achievements
Rank 3
Bronze
Bronze
Bronze
 answered on 13 Jan 2023
1 answer
71 views

I have a TelerikGrid with OnRead set with code that retrieves Paged data via an API.

I store the items + page number + total items etc so that when the user returns they see their previous search.

I tried using OnStateInit, but it only lets me set the page number - not the data items or total results.

 

Dimo
Telerik team
 answered on 13 Jan 2023
1 answer
258 views

Hello,
I would like to customize the filtering view window in Gantt. Is there a possibility to search for simple values using a text field?
In addition, I would also like to make changes to the labels (language: German).

The same applies to the event settings (double-click on events), where I would also like to change the language to German.

 

Many thanks in advance.

Hristian Stefanov
Telerik team
 answered on 13 Jan 2023
1 answer
156 views

When export the grid to excel is there a way to tell it to use the row colors the grid shows on the page?

 

Thanks.

Nadezhda Tacheva
Telerik team
 answered on 12 Jan 2023
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?