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

I receive from other developer workable application with Blazor and Telerik UI. I have installed Telerik UI successfully to my machine, then install package Telerik.UI.for.Blazor.Trial. Site successfully compiled and started. But Blazor UI don't working.

 

Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
 answered on 08 Jul 2021
1 answer
644 views

Can i use Panelbar ContentTemplate as a dynamic template in a view?

Example: i want different ContentTemplate to render depending on a property.value?

code is from Telerik's own example with my addition

<TelerikPanelBar Data="@FlatData" @bind-ExpandedItems="@ExpandedItems">
    <PanelBarBindings>
        <PanelBarBinding>
@{ var _c = context as object

@if(_c.GetType() = Type)
{
            <ContentTemplate>
                <div class="panelbar-template">
                    <h2 class="k-text-primary">Custom Template:</h2>
                    @(((PanelBarItem)context).Text)
                </div>
            </ContentTemplate>
}
else
{
 <ContentTemplate>
                <div class="panelbar-template">
                    <h2 class="k-text-primary">Custom Template 2:</h2>
                    @(((PanelBarItem)context).Text)
                </div>
            </ContentTemplate>
}
}
            <HeaderTemplate>
                <strong>@(((PanelBarItem)context).Text.ToUpper())</strong>
            </HeaderTemplate>
        </PanelBarBinding>
    </PanelBarBindings>
</TelerikPanelBar>


Marin Bratanov
Telerik team
 answered on 07 Jul 2021
1 answer
173 views

I have a problem when I tried to add a control on the TreeListCommandButton
the context is not resolved
Telerik version: 2.17.0

<TreeListCommandColumn Width="220px">
                @{
                    var modelHierarchyInfo = (ModelHierarchyInfo)context;
                     if (modelHierarchyInfo.DepthLevel < 2)
                     {
                    <TreeListCommandButton Command="Add" Icon="add"></TreeListCommandButton>
                     }
                }
                <TreeListCommandButton Command="Edit" Icon="edit"></TreeListCommandButton>
                <TreeListCommandButton Command="Delete" Icon="delete"></TreeListCommandButton>
                <TreeListCommandButton Command="Save" Icon="save" ShowInEdit="true"></TreeListCommandButton>
                <TreeListCommandButton Command="Cancel" Icon="cancel" ShowInEdit="true"></TreeListCommandButton>
   </TreeListCommandColumn>
Dimo
Telerik team
 answered on 07 Jul 2021
1 answer
129 views

Hi Team,

Is that possible to add column name for draggable row in Telerik grid.

Please find the attached screen shot for your reference.

Thank you.

Lakshmipathi K

Dimo
Telerik team
 answered on 07 Jul 2021
1 answer
610 views

I have a Telerik Blazor Grid where I am doing a custom OnRead event to get the data.

I am trying to detect within that event handler when the grid filters have changed as I need to request extra data if someone changes the grid filters in anyway.

I have tried comparing the previous filters with the new request filters but it says they are always different even when just requesting a new page in the grid.

My code looks like this:

protected override async Task OnReadHandler(GridReadEventArgs e)
{
    if (!ReHydrateGridFromPersistedState)
    {
        //no grid state exists so call the database for data
        var filtersHaveChanged = GridRequest != null && !GridRequest.Filters.Equals(e.Request.Filters);

        GridRequest = e.Request;

        if (filtersHaveChanged)
        {
            ExtraData = await GetExtraDataAsync();
        }

        await base.OnReadHandler(e);
    }
    else
    {
        GridRequest = e.Request;
    }
}
var filtersHaveChanged = GridRequest != null && !GridRequest.Filters.Equals(e.Request.Filters);

/* filtersHaveChanged is ALWAYS true */

Marin Bratanov
Telerik team
 answered on 06 Jul 2021
1 answer
2.9K+ views
I use data annotations heavily in my view models. I understand that if I let the Telerik form tag I can get the labels to generate and display from my data annotations but I am not auto generating my forms.   How do I make use of the Data Annotations with hand crafted forms?
Marin Bratanov
Telerik team
 answered on 06 Jul 2021
0 answers
1.9K+ views

I've implemented code that will save the state of the grid columns and reapply that state when the grid renders.  If a column is rearranged to a new location it seems to cause a problem with the resizing logic.  In my case, I've got a grid with many columns (37).  I rearrange a single column.  This results in the new column state being saved.  (In this example, all I have done is move 1 column from its original position).  I then refresh the page.  On page initialization, the column state is read and applied to the grid.  Next, I resize a single column. (In this example, the first column).  The result is that every column between the original location of the moved column and its new location are resized.

What appears to be happening is that somehow the grid saved the columns widths for each column before the resizing and then after the first column was resized, the rest of the columns had their original column widths reapplied but its ignoring the fact the the column state had changed after loading so that the column widths are being applied to the wrong columns.  (This feels like an awful explanation and is hard to follow I'm sure).  I'm attaching a screenshot of the before/after html that illustrates how the column widths get messed up.  Hopefully the visualization will help.  The image shows the state of the column widths before and after the first column is resized.

Jeffrey
Top achievements
Rank 2
Iron
Veteran
Iron
 updated question on 06 Jul 2021
1 answer
852 views

Hi,

I wanted to disable the particular row in Telerik grid (or) disable the particular row buttons on grid.

Please help me out ASAP.

Thank you,

LakshmiPathi K

Matthias
Top achievements
Rank 5
Bronze
Bronze
Iron
 answered on 06 Jul 2021
1 answer
171 views
I'm trying to pass a string containing a '<strong>#</strong>' character to an OData api and DataSourceRequest.ToODataString() is not encoding the character.&nbsp; Is it suppose to?
Svetoslav Dimitrov
Telerik team
 answered on 06 Jul 2021
2 answers
2.9K+ views

Hello, I have been using the TreeView and NumericTextBox components in 2.22 and 2.24 for months now without a problem. Today I added a ContextMenu to the project and carefully followed the instructions for client-side apps. After many hours of solid research, the new component produces nothing but: A Telerik component on the requested view requires a TelerikRootComponent to be added to the root of the MainLayout component of the app.

I have checked the documentation and all the obvious files related to this, and they all seem okay, except the sample MainLayout.cs file does not work as written (is it erroneous?). I have pasted mine below.

I'm using the single package Telerik.UI.for.Blazor 2.24.0. The project is very large, so I can only paste a few snippets below. I've completely run out of ideas on this problem. Maybe I'm missing a css or js file, or a package -- Thanks, Greg

index.html

<link rel="stylesheet" href="_content/Telerik.UI.for.Blazor/css/kendo-theme-default/all.css" />
<script src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js" defer></script>

Program.cs

builder.Services.AddTelerikBlazor();

TelerikLayout.razor

@inherits LayoutComponentBase

<TelerikRootComponent>
  @Body
</TelerikRootComponent>

MainLayout.razor

@inherits TelerikLayout

@Body

gfkeogh
Top achievements
Rank 1
Iron
 answered on 05 Jul 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?