Telerik Forums
UI for Blazor Forum
1 answer
49 views

Hi all,

I used https://www.telerik.com/blazor-ui/documentation/components/pdfviewer/toolbar to customize my toolbar and it works fine.

So, I need to hide/show Download and Print Buttons according user and kind of report.

How do I hide this buttons inside my blazor code?

 

Regards,

Nelson

Ivan Danchev
Telerik team
 answered on 28 Nov 2025
1 answer
45 views

Hi

I want to add a textbox in the  GridToolBarTemplate. Because of the built-in arrow navigation it is not possible to move the cursor inside the textbox. Is it possible to disable the default arrow navigation in the GridToolBar?

Example in this simple REPL

Enter any text in the Textbox, hit the left arrow keyboard button and notice the cursor stays at the end of the text.

 

Best regards

Bram

Dimo
Telerik team
 answered on 20 Nov 2025
1 answer
47 views

Version 12.0.0 removed the .k-item class from rendering on a tab strip's tab but that now means that the active tab looks identical to all other tabs. Is there a workaround or some way to get that back without manually recreating the CSS myself? 

 

The screenshot is from the docs to show it's not just my project or any custom config on my end:

https://www.telerik.com/blazor-ui/documentation/components/tabstrip/overview

Dimo
Telerik team
 answered on 19 Nov 2025
1 answer
44 views

I'm writing an OnShapeClick method that (among other things) should change the Color of the selected shape. I am defining shapes as such: 

<DiagramShapes>
    @foreach (Node node in Nodes)
    {
        <DiagramShape Id="@node.LinkID" >
            <DiagramShapeContent Text="@node.GetDisplayName()" />
            <DiagramShapeFill Color="@node.GetColor()"/>
        </DiagramShape>
    }
</DiagramShapes>

In OnShapeClick, I am updating the Color by changing a field for the specified node that results in node.GetColor() returning a new Value, and this works. 

async Task OnPersonClick(DiagramShapeClickEventArgs Args)
{
    foreach (Node node in Nodes)
    {
        if (node.LinkID.Equals(Args.Id))
            node.State = SelectedState.True;
        else
            node.State = SelectedState.False;
    }
}

The issue is that when the Diagram is re-rendered, the positions of all the shapes are recalculated. resulting in any Shapes that the user has dragged out of position to revert to their original position, or in the case of the Force Diagram, a complete reshuffle of the Shapes in the Diagram. This is undesired behavior. 

In short, how do I update the Color (or any property) of a Diagram Shape while maintaining the current positions of all shapes within the Diagram?

Dimo
Telerik team
 updated answer on 18 Nov 2025
0 answers
34 views

Hi all,

When TelerikTreeView is used within TelerikWindow's WindowContent, mouse hover events trigger continuous re-rendering of the entire window content, resulting in significant performance degradation. However, using TelerikTreeView directly on a page outside the window doesn't cause these re-rendering issues.


<TelerikWindow Visible=true>
    <WindowContent>
            <TelerikTreeView Data="@TreeData">
                <TreeViewBindings>
                    <TreeViewBinding>
                        <ItemTemplate>
                            @{
                                TreeItem itm = context as TreeItem;
                                <span @onclick="@( _ => NodeClick(itm) )">
                                    Node:
                                    <strong>@itm.Text</strong>
                                </span>
                            }
                        </ItemTemplate>
                    </TreeViewBinding>
                </TreeViewBindings>
            </TelerikTreeView>
    </WindowContent>
</TelerikWindow>

@code {
    string result { get; set; }
    async Task NodeClick(TreeItem clickeNode)
    {
        result = $"Last clicked node Id: {clickeNode.Id}";
    }

    // sample data

    public IEnumerable<TreeItem> TreeData { get; set; }

    public class TreeItem
    {
        public string Text { get; set; }
        public int Id { get; set; }
        public List<TreeItem> Items { get; set; } = new List<TreeItem>();
        public bool HasChildren { get; set; }
    }

    protected override void OnInitialized()
    {
        LoadHierarchical();
    }

    private void LoadHierarchical()
    {
        List<TreeItem> roots = new List<TreeItem>() {
            new TreeItem { Text = "Item 1", Id = 1, HasChildren = true },
            new TreeItem { Text = "Item 2", Id = 2, HasChildren = true }
        };

        roots[0].Items.Add(new TreeItem
        {
            Text = "Item 1 first child",
            Id = 3

        });

        roots[0].Items.Add(new TreeItem
        {
            Text = "Item 1 second child",
            Id = 4

        });

        roots[1].Items.Add(new TreeItem
        {
            Text = "Item 2 first child",
            Id = 5

        });

        roots[1].Items.Add(new TreeItem
        {
            Text = "Item 2 second child",
            Id = 6

        });

        TreeData = roots;
    }
}



Andrey
Top achievements
Rank 1
 updated question on 18 Nov 2025
0 answers
39 views

We're starting a new internal project using Blazor (.NET 8/10) to build an in-house booking application.

Our UI/UX designs are already prepared in Figma, and we're now evaluating which Blazor component library would best support our implementation.

We are exploring component library which can easily be integrated with Figma design, save us re writing a component and reduce the development time.

  • What was your experience like?

  • How well did the components align with your design system (especially if using Figma)?

  • Any performance, customization, or support issues?

  • Would you recommend it for a booking-style application?

  • Are free source component libraries better than enterprise paid libraries?

Thanks in advance for sharing your insights!

U
Top achievements
Rank 1
 asked on 16 Nov 2025
1 answer
57 views

I've followed everything i can find about enforcing UTF-8 encoding, but this is still happening. It only happens in the drop down options of the aforementioned components, not after they are selected and not in the ASP.NET core <InputSelect> component.

 

 

Dimo
Telerik team
 updated answer on 13 Nov 2025
1 answer
38 views

I have no idea when this started but I suspect when we upgraded to 11.x control suite.

<GridColumn Field=@nameof(BookingEquipmentCommodityModel.ItemCount) Title="Count" Width="1.5rem" />

As you can see, there is no numeric template and this is a simple GridColumn, but I'm getting increment arrows on any column that is numeric (Int, Decimale, Double, etc.)?

I don't want them and have no idea why I'm getting them since I don't define the column with a template for TelerikNumericTextBox??

In my attempt (which failed) to work-around this issue, I setup a template for the column using TelerikNumericaTextBox to see I could disable the arrows ... and that didn't work either?

                                <GridColumn Field=@nameof(BookingEquipmentCommodityModel.CommodityWeight) Editable="true" Title="Weight" Width="3rem">
                                    <Template Context="cwContext">
                                        @{
                                            var cw = (BookingEquipmentCommodityModel)cwContext;
                                        }
                                        <TelerikNumericTextBox @bind-Value="@cw.CommodityWeight" Arrows="false"></TelerikNumericTextBox>
                                    </Template>
                                </GridColumn>

still get the arrows?

Help?

Dimo
Telerik team
 answered on 13 Nov 2025
1 answer
35 views

I have no problem with adjusting filter values (trim white space) when the Grid uses OnRead event:

    private async Task OnBookingGridRead(GridReadEventArgs args)
    {
            // Are any filters selected, if so we need to work from the filtered List
            if (args.Request.Filters.Count > 0)
            {

                await TrimFilters(args.Request.Filters);

and the cycle thru filter values and trim them:

    // Removes white space (aka Trim) on any filter input 
    private Task TrimFilters(IList<IFilterDescriptor> filters)
    {
        // Cycle the filters and trim Values
        foreach (var filterDescriptor in filters)
        {
            switch (filterDescriptor)
            {
                case FilterDescriptor singleFilterDescriptor:
                    // Only one filter
                    singleFilterDescriptor.Value = singleFilterDescriptor.Value.ToString()?.Trim();
                    break;
                case CompositeFilterDescriptor compositeFilter:
                {
                    foreach (var subFilter in compositeFilter.FilterDescriptors)
                    {
                        if (subFilter is FilterDescriptor singleSubFilter)
                        {
                            singleSubFilter.Value = singleSubFilter.Value.ToString()?.Trim();
                        }
                    }

                    break;
                }
            }
        }

        return Task.CompletedTask;
    }

All good works fine ... BUT ... if the Grid is not using OnRead (using Data=), how can I accomplish the same task of removing white space (trim) from user filter input values?

 

Dimo
Telerik team
 answered on 13 Nov 2025
1 answer
34 views

Hi all,

 

I'm using the GridState, and in particular, the GridColumnStates, to restore user-defined column sizes when getting back to a page that contains a grid.

While it's cool that a state can easily be retrieved and set, what I dislike about it is that column widths are treated in absolute sizes (pixels) instead of relative (%). When a state is restored to a different overall resolution (affecting the grid's width), the pixel sizes may not be appropriate.

However, I found out that the Width property is a string, and will also accept ratios when setting the state. I'm persisting the per-grid column configuration in JSON, so this bit of code now takes care of creating the JSON document for me, changing the pixel widths per column by the respective percentage ratio:


public static string GetGridColumnStateJsonScaled<T>(TelerikGrid<T> grid)
{
    var gridTotalWidth = grid.GetState().TableWidth;
    var states = grid.GetState().ColumnStates;
    if (gridTotalWidth.EndsWith("px"))
    {
        var gridWidthPx = decimal.Parse(gridTotalWidth, CultureInfo.InvariantCulture);
        if (gridWidthPx != 0)
        {
            foreach (var state in states.Where(_ => _.Width.EndsWith("px")))
            {
                var colWidthpx = decimal.Parse(state.Width, CultureInfo.InvariantCulture);
                var ratio = Math.Round(colWidthpx * 100 / gridWidthPx, 3);
                state.Width = ratio.ToString(CultureInfo.InvariantCulture) + "%";
            }
        }
    }
    var json = JsonSerializer.Serialize<ICollection<GridColumnState>>(states);
    return json;
}

 

The code presumes that the grid width (drawn from the grid's current state) is pixels - usually that should be the case. Also, it will only recalculate columns whose width is also specified with a "px" unit. It will overwrite the original width value inside the state.

This needs to be used whenever a state is about to be persisted as column sizes will be all pixels again as soon as the user modifies anything that affects the state.

While this does work, there might be a more elegant solution that I missed. In case there is not, feel free to use the code above :)

 

Cheers,

Joe

Dimo
Telerik team
 answered on 12 Nov 2025
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?