Telerik Forums
UI for Blazor Forum
1 answer
170 views

I made my first datagrid.  I created very simple code just to get some data and to show it in the grid. Result is unacceptable. I attached a .png file to explain what I mean.

Code looks like this:

@page "/brorg"

@using BezraSrv
@using BezraSrv.Models

<h3>Brorg</h3>

<TelerikGrid Class="grid"
             Data=@bRORG
             Sortable="true"
             FilterMode="GridFilterMode.FilterMenu"
             ScrollMode="GridScrollMode.Virtual"
             Height="480px" RowHeight="60"
             PageSize="10"
             Size="@ThemeConstants.Grid.Size.Small">
    <GridColumns>
        <GridColumn Field="@nameof(BezraSrv.Models.BRORG.ORGID)" Title="Org. id"></GridColumn>
        <GridColumn Field="@nameof(BezraSrv.Models.BRORG.NAZIV)" Title="Naziv"></GridColumn>
    </GridColumns>
</TelerikGrid>

<style>
    .width-100 {
        width: 100%;
    }
    .grid .k-grid-content tr {
        line-height: 32px;
    }
</style>

@code {
    [Inject]
    public DataService DataService { get; set; }

    protected IEnumerable<BezraSrv.Models.BRORG> bRORG;

    protected override async Task OnInitializedAsync()
    {
        bRORG = await DataService .GetBRORG();
    }
}

Djordje
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 12 Dec 2023
1 answer
799 views

Is there a plan to fix this in the long term? The "work-around" listed in your documentation, Configure the Render Mode per Page found at https://docs.telerik.com/blazor-ui/getting-started/web-app#configure-the-render-mode-per-page technically functions as the root component error goes away and site starts working... 

However, it misses the bigger issue in that it now loads the entire page including all of the layout code and components, re-executing them as well... put some components in the TelerikLayout and add break points to the OnInit functions to see what I am referring to. It will now do this for every single page in application now...

So... to my initial question... what is the plan to fix/address the TelerikRootComponent in the multiple rendering mode world that is .NET 8 now?

I will say it looks like the Blazor team added a new concept of using builder.Services.AddCascadingValues() to address this problem, I have used it with our internal RootComponent to fix this same concept with our internal code... thoughts?

builder.Services.AddTelerikCascadingParameters(); is referenced at url below:

https://github.com/dotnet/aspnetcore/issues/50724 by SteveSandersonMS, I realize he was just throwing out an idea, the above line of code doesn't actually exist to my knowledge, at least not yet... :)

 

Thanks in advance!

 

Dimo
Telerik team
 answered on 11 Dec 2023
0 answers
87 views

I'm  using telerik grid blazor and datatable as datasource properties like filtering,sorting are working but when i enable grouping it loads and does not provide me a grouping data.

Is there any solution for this?

Nikilesh
Top achievements
Rank 1
 asked on 11 Dec 2023
1 answer
179 views

I need to get the node number of the tree view.  I know there is a TreeItem that has the Level property but I can't figure out how to get it.  I tried using an Item Template and that is where I am stuck.  I couldn't figure out how to get the item info.

Here is my current tree view which works fine but I can't get the level.
<div>This is the tree view <br />
<TelerikTreeView
    Data="TreeViewList">
    <TreeViewBindings>
        <TreeViewBinding 
            ParentIdField="ParentId"
            IdField="Id"
            HasChildrenField="HasChildren"
            TextField="Name">
        </TreeViewBinding>
    </TreeViewBindings>
</TelerikTreeView>
</div>

Craig
Top achievements
Rank 1
Iron
 updated answer on 11 Dec 2023
1 answer
206 views

Hello,

I'm trying to figure out how does the NuGet API Key works for Telerik feed when it comes to security. I created an API Key on my account for the NuGet feed. I used it in Visual Studio via NuGet.config file method. Everything was working fine. Then I deleted the API Key from my account. I made the test again and everything seems to still work in Visual Studio.

I was under the impression that the key should be invalidated and stop working after I deleted it. How does it work exactly so I can make sure I can use it in a safe way? Does the key still work after deletion until it's expiration date?

Rafał
Top achievements
Rank 1
Iron
 updated answer on 10 Dec 2023
1 answer
175 views
Is there a list somewhere of the Telerik Blazor Components that depend or need the TelerikRootComponent... because a lot of them work without it... the TelerikButton for example can work without it... a definitive list would be nice, thanks in advance!
Dimo
Telerik team
 answered on 08 Dec 2023
1 answer
123 views

Telerik + dotnet 8 is really annoying.

You cant mark a component as interactive, because that requires a telerikrootcomponent, and you cant put a telerikrootcomponent at the top level because then the specific component cant find the telerikrootcomponent.

And the docs https://docs.telerik.com/blazor-ui/troubleshooting/general-issues#wrong-popup-position provide no workaround at all.

Dimo
Telerik team
 answered on 07 Dec 2023
1 answer
175 views
Does it work in .NET8? I just installed trial version and it show 5.01 version and do not create new Blazor server app.
Dimo
Telerik team
 answered on 07 Dec 2023
1 answer
186 views
I tried to install nuget packages in my new test application and set VS for accessing nuget.telerik.com. After several attempts I was prompt for credentials. Nothing happend, then in second try it works. After that I never entered list of telerik packages with comment Error 401. I tried everything, reset credentials in window credential manager. Even changed my mail trying to reset all but nothing happen. Obviously my credential to enter my telerik account is valid as I am logged in but nuget packages are not available to me.
Dimo
Telerik team
 answered on 07 Dec 2023
1 answer
99 views

Hi,

I am trying to setup the ability for users to delete a row in a <TelerikGrid>

<TelerikGrid 
                Data="@(Results)"
                EnableLoaderContainer="true"
                Pageable="true"
                Sortable="true"
                Resizable="true"
                FilterMode="GridFilterMode.FilterMenu"
                PageSize="15"
                SelectionMode="GridSelectionMode.Multiple"
                SortMode="@SortMode.Single"
                Height="70vh"
                @ref="@GridRef"
            >
<GridColumn Title="Delete" Width="5vh">
                        <Template>
                            @if (context is MyModel model)
                            {
                            <div @key="@model.UniqueId">
                                <div class="icon-container" @onclick="@(() => HandleDeleteClicked(model))">
                                    <i class="far fa-trash font-icon-large"></i>
                                </div>
                            </div>
                            }
                        </Template>
                    </GridColumn> 
private async Task HandleDeleteClicked(MyModel model)
    {
            Results.Remove(model);
    }


This part all works fine, it removes the row, and since 'Results' is an 'ObservableCollection<MyModel>' it updates the UI, perfect.

The problem is I can't seem to get it so that every cell is not re-rendering/re-created when the delete happens.

I have a column that has a sub-component inside it...


<GridColumn Title="MyCustomColumn" Field="@nameof(MyModel.MyField)">
                        <Template>
                            @{
                                @if (context is MyModel result)
                                {
                                    <div @key="@result.UniqueId">
                                        @{
                                                    <MyCustomComponent></MyCustomComponent>
                                            }
                                    </div>
                                }
                            }
                        </Template>
                    </GridColumn>

'MyCustomComponent' has an expensive API call in the 'OnParametersSetAsync' lifecycle method. Even though I have the @key attribute setup it seems to re-create the 'MyCustomComponent' for every row anytime a single row is deleted.

This gets called for every row:
// MyCustomComponent.razor.cs    
private Guid? ComponentInstanceId { get; set; } protected override Task OnInitializedAsync() { ComponentInstanceId = Guid.NewGuid(); return base.OnInitializedAsync(); }


The Id I am using for the key I can confirm is not changing.

Is there a better way to help the grid know when it needs to re-create the cells?

Thanks!

Dimo
Telerik team
 answered on 07 Dec 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?