Telerik Forums
UI for Blazor Forum
0 answers
1.6K+ views

Hi, I'd like to close all tabs, which were opened by user.

I have problem, it still closes only one opened tab. I use this methods:

 <TelerikButton OnClick="@OpenTabC" Primary="true">Open Tab C</TelerikButton>
<TelerikButton OnClick="@OpenTabF" Primary="true">Open Tab F</TelerikButton>
<TelerikButton OnClick="@CloseTabs" Primary="true">Close Tab</TelerikButton>

 

async Task OpenTabC()
    {
        await JS.InvokeVoidAsync("open", $"counter", "_blank");        
    }

    async Task OpenTabF()
    {
        await JS.InvokeVoidAsync("open", $"fetchdata", "_blank");
    }

    async Task CloseTabs()
    {        
        var loadDataTasks = new Task[]
        {
            Task.Run(async () =>  await JS.InvokeVoidAsync("close", $"counter")),
            Task.Run(async () =>  await JS.InvokeVoidAsync("close", $"fetchdata"))
        };

        try
        {
            Task.WaitAll(loadDataTasks);
        }
        catch (Exception ex)
        {
            // handle exception
        }        

  }

What is wrong in CloseTabs method, please, why does it close only one tab?

It is possible to do without JS.InvokeVoidAsync?

Thank you

Peter

Peter
Top achievements
Rank 1
Iron
Iron
 updated question on 14 Apr 2022
1 answer
381 views

Telerik Team,

Currently, I am concatenating the text field value of dropdown list  to include spaces or tabs in order to show data indented as tree view. Seems like the Telerik dropdown list component is removing space or tabs. I have also tried using &nbsp; (HTML tag) to accomplish this task. But this does not seem to work as well (may be due to HTML encoding/decoding). Is there are a way I can show the list items as intended data.

Thank you for your help.

Beena.

Dimo
Telerik team
 answered on 14 Apr 2022
1 answer
389 views

Hello,

I am developing a mission critical application using Blazor and your beautiful components.

Alas, I'm in big trouble, because everything is painfully slow. I have been able to solve many problems following the suggestions I found in your documentation, but now I'm stuck, trying to use the TreeView component.

I need to show a fully expanded tree with 200/300 nodes, and it takes forever to rendere. Like 5 seconds in debug, and around 4 seconds in release mode. Even trying an AOT release, didn't solve the problem, nor gets it better in any perceptible way. Thi sounds madness to me. I'm starting to heavily regret ot have not chosen React to develop my application...

Watching the log window of Chrome during the rendering of the expanded nodes I see thounds of rows like these:

"Rendering component NNNN of type Telerik.Blazor.Components.Common.Animation.AnimationGroup"
"Rendering component NNNN of type Telerik.Blazor.Components.TreeView.TreeViewNode"
"Rendering component NNNN of type Telerik.Blazor.Components.TelerikAnimationContainer"

Is it possible in someway to get a more... I dont' know... streamlined rendering of the tree?

Even if I do not expand automatically the tree and I leeve the user do it... if, as i can happen, I have the 200/300 nodes all under only one root node, it takes the same time, which, from a user standpoint is simply, and understandably, incomprehensible.

Thank you.

Svetoslav Dimitrov
Telerik team
 answered on 14 Apr 2022
1 answer
415 views

Hi,

I have a need to be able to get partially checked root items. Basically, I want to tell by looking a given child node, who it's root parent is.

Is there a way I can tell which are partially checked?

Thanks ... Ed

 

Nadezhda Tacheva
Telerik team
 answered on 14 Apr 2022
2 answers
218 views

Greetings, I want to make the DatePicker display by pressing F4 as other components do naturally, I already managed to make it display, but it only happens with the first DatePicker on the screen with the rest not working.

each RadDatePicker, I assign a unique id, that's no problem

could you explain to me how to make your control display the popup to select the date manually

this is the structure of my HTML with its RadDatePicker

<span class="k-datepicker wInput-date k-valid telerik-blazor k-input k-input-md k-input-solid k-rounded-md" data-id="cf018d18-c08c-477f-8a91-213944083232" data-val-id="938552dd-ed5a-4bea-833b-41f110a1c366" _bl_2d436386-enter code here7760-4ba0-9a8b-18c6033ed832=""> <span class="k-dateinput k-valid telerik-blazor k-input k-input-md k-input-solid k-rounded-md" role="combobox" aria-expanded="false" aria-haspopup="true"> <input class="k-input-inner" id="938552dd-ed5a-4bea-833b-41f110a1c366" tabindex="11" data-id="793b152c-d5e6-44b8-abef-fee3838ad1f5" type="text" _bl_cf0feb89-9608-41f7-a7d0-bcfab324c628=""> </span> <button class="telerik-blazor k-button k-input-button k-button-solid k-rounded-md k-button-rectangle k-button-md k-button-solid-base k-icon-button" id="8ec8f7d4-af4e-4340-9540-e424aa647b95" data-id="e0f6604d-8572-4aac-850d-d648a4c5ff37" tabindex="-1" aria-disabled="false" type="button"> <span class="k-icon k-i-calendar k-button-icon"></span> </button> </span>

So I managed to display the popup, of course the id I sent it from Blazor to JS

$("#938552dd-ed5a-4bea-833b-41f110a1c366").closest('.wInput-date').children("button").trigger("click"); 

Use:

Visual Studio 2022

Blazor Telerik 3.1
ASP Core 6

Danny
Top achievements
Rank 1
Iron
Veteran
Iron
 answered on 13 Apr 2022
1 answer
133 views
I am considering purchasing blazor components. I'm doing tests with the trial version. I would like to know if it is possible to insert new data in a specific grid position. Specifically, I would like to insert the data after the selected row of the grid.
Svetoslav Dimitrov
Telerik team
 answered on 11 Apr 2022
1 answer
414 views

ChartTitle has a Color property, but ChartLegend does not. How can I change the text to white?

Svetoslav Dimitrov
Telerik team
 answered on 11 Apr 2022
1 answer
900 views
Hi all,

I am using the DateTimePicker with a nullable property 
public DateTime? EndDate { get; set; }
When the user selects the picker, I would like the time defaulted to midnight as most times we use midnight, so it's a mission for users to always have to set the time to midnight when applying a date just a date. The time is there for the odd times we do want to have EndDate with a time - but's it is not the norm.

Is there a way to tell the component to default to midnight?

Marin Bratanov
Telerik team
 answered on 09 Apr 2022
1 answer
180 views

When using the TelerikDropDownList component in Blazor, the html generated sometimes contains title="null" in the outer span element. This then shows up as a tooltip of null when hovering the dropdownlist control on the rendered page.

What could be causing this and is there a way of suppressing it?

Thank you.

Dimo
Telerik team
 answered on 08 Apr 2022
1 answer
195 views

Hello,

I have a TelerikGrid like this:

<TelerikGrid @ref="gridRef"
Data="@MyData" 
Pageable="@pageable" 
PageSize="15"
Sortable="true"
SelectionMode="GridSelectionMode.Single"
SelectedItemsChanged="@((IEnumerable<MyDataViewModel> itemList) => OnRowClick(itemList))"
SelectedItems="selectedRow"
OnRowDoubleClick="@OnRowDbClick"
OnRowContextMenu="@Menu"
OnStateInit="@((GridStateEventArgs<MyDataViewModel> args) => OnStateInitHandler(args))">

Works fine.

But on page load, my OnRowClick-method will be fired with an empty [] as parameter.

Is that working correctly?

In my case, I can make a workaround for that, but maybe that is not the designed behaviour? :-)

Runs on .net6.0.3. Testet on Firefox on Windows10. Telerik.UI.for.Blazor 3.1.0

Nadezhda Tacheva
Telerik team
 answered on 07 Apr 2022
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?