In our application we use some large datasets and present them in a TelerikGrid. We use WPF + Blazor Hybrid and noticed, that in some cases the memory usage of the Web View process grows up to some gigabytes.
Here a screenshot of the task manager with a lot of RAM usage for the web view.
Here a screenshot of the detached DOM elements after a two navigations. The container divs are not garbage collected.
I tracked down the issue to come from the TelerikGrid, because when I remove it from the pages, everything runs fine. I also removed all GridColumns and the issue is still present. In the developer tools I noticed that one of the parent div elements remains in memory every time I navigate back and forth.
I also created a blank Blazor WebAssembly Standalone application and added a simple instance of the grid. Here, the issue is also present. I attach the one blazor page that causes the issue.
I've tested all major versions from 5.1 upwards, every version is affected.
After upgrading to 12.0.0, the Content does not change when clicking tabs. I always see the Content of the first tab.
My project targets .net8.
A flexible and accessible image viewer / selector for Blazor applications, similar to what popular eCommerce websites use to show products.
Height and Width parameters to fit various UI needs.ConstrainImageHeight and ConstrainImageWidth parameters allow precise control over aspect ratio, whether to maintain aspect ratio and/or constrain height and width.ImageInfo objects, each with a required image source and optional alt text for accessibility.@inject ITelerikStringLocalizer Loc
<LanguageTrackProvider OnInitializeEvent="provider => provider.RegisterComponent(this)" />
@if (Images.Any() && _selectedImage != null)
{
<div class="d-flex @Class" style="height: @Height; width: @Width;">
<ul aria-label="@Loc["ImageThumbnails"]" role="radiogroup" class="image-collection-button-container">
@foreach (var image in Images)
{
<li>
<button @onclick="() => OnImageSelect(image)"
class="@($"image-collection-button{(image.Src == _selectedImage.Src ? " selected" : "")}")"
role="radio" aria-checked="@(image.Src == _selectedImage.Src ? "true" : "false")">
<img src="@image.Src" alt="@image.Alt" />
</button>
</li>
}
</ul>
<div class="image-collection-image-container">
<MagnifiableImage Image="@(new ImageInfo(_selectedImage.Src, _selectedImage.Alt))" Class="image-collection-image" MagnifyScale="@MagnifyScale"
Height="@(ConstrainImageHeight ? "calc(100% - 2px)" : "auto")" Width="@(ConstrainImageWidth ? "100%" : "auto")" />
</div>
</div>
}
else
{
<TelerikSkeleton ShapeType="@SkeletonShapeType.Rectangle" Height="@Height" Width="@Width" Class="@Class"/>
}
<style>
.image-collection-button-container {
flex: 0 0 auto;
width: 10%;
height: 100%;
min-width: 90px;
max-width: 110px;
overflow-y: auto;
padding: 2px;
margin: 0;
scrollbar-color: rgba(1, 1, 1, 0.25) rgba(0, 0, 0, 0);
scrollbar-gutter: stable;
list-style: none;
}
.image-collection-button {
padding: 0;
margin-bottom: 1rem;
border: 1px solid var(--kendo-color-border, rgba(0, 0, 0, 0.08));
border-radius: 0.5rem;
width: auto;
aspect-ratio: 1 / 1;
display: block;
}
.image-collection-button:hover {
filter: brightness(90%);
}
.image-collection-button:focus {
outline: none;
box-shadow: 0 0 0 2px color-mix(in srgb, var(--kendo-color-on-app-surface, #424242) 50%, transparent);
}
.image-collection-button.selected {
box-shadow: 0 0 0 2px var(--kendo-color-primary, #1274AC);
}
.image-collection-button img {
width: 100%;
height: 100%;
min-width: 70px;
min-height: 70px;
max-width: 90px;
max-height: 90px;
object-fit: cover;
border-radius: 0.5rem;
display: block;
}
.image-collection-image-container {
flex: 0 0 auto;
width: 90%;
padding: 2px;
}
.image-collection-image {
border: 1px solid var(--kendo-color-border, rgba(0, 0, 0, 0.08));
}
</style>using Microsoft.AspNetCore.Components;
using Telerik.Blazor.Components;
namespace RazorLibrary.Components.Images;
/// <summary>
/// <para>
/// Displays a collection of selectable image thumbnails provided by <see cref="Images"/> and a main image display area.
/// If <see cref="Images"/> is empty, displays a <see cref="TelerikSkeleton"/> placeholder instead. Supports
/// accessibility, configurable height via <see cref="Height"/>, width via <see cref="Width"/>, aspect ratio control
/// via <see cref="ConstrainImageHeight"/> and <see cref="ConstrainImageWidth"/>, and alt text for images.
/// </para>
/// <para>
/// Usage:
/// <code>
/// @using RazorLibrary.Components.Images
///
///
/// <ImageCollection Images="myImages" Height="300px" Width="100%" />
///
///
/// @code {
/// private List<ImageInfo> myImages = new()
/// {
/// new ImageInfo("img1.jpg", "First image"),
/// new ImageInfo("img2.jpg", "Second image")
/// };
/// }
/// </code>
/// </para>
/// </summary>
public partial class ImageCollection
{
/// <summary>
/// The collection of images to display in the image collection.
/// </summary>
[Parameter] public IEnumerable<ImageInfo> Images { get; set; } = [];
/// <summary>
/// The overall height of the image collection component (e.g., "200px", "100%", or "auto"). Default is "auto".
/// </summary>
[Parameter] public string Height { get; set; } = "auto";
/// <summary>
/// The overall width of the image collection component (e.g., "200px", "100%", or "auto"). Default is "auto".
/// </summary>
[Parameter] public string Width { get; set; } = "auto";
/// <summary>
/// If true, sets the main image display height to 100%, which constrains it to the value specified by <c>Height</c>.
/// If false, height is auto. Maintains aspect ratio unless both <c>FixImageHeight</c> and <c>FixImageWidth</c> are true.
/// Default is false.
/// </summary>
[Parameter] public bool ConstrainImageHeight { get; set; } = false;
/// <summary>
/// If true, sets the main image display width to 100%, which constrains it to the value specified by <c>Width</c>.
/// If false, width is auto. Maintains aspect ratio unless both <c>FixImageHeight</c> and <c>FixImageWidth</c> are true.
/// Default is true.
/// </summary>
[Parameter] public bool ConstrainImageWidth { get; set; } = true;
/// <summary>
/// The magnification scale for the magnifier. Default is 3 (3x magnification).
/// </summary>
[Parameter]
public double MagnifyScale { get; set; } = 3;
/// <summary>
/// Applies additional CSS classes to the ImageCollection's root element for custom styling and visual modifications.
/// </summary>
[Parameter] public string Class { get; set; } = string.Empty;
private ImageInfo? _selectedImage;
/// <inheritdoc />
protected override void OnInitialized()
{
_selectedImage = Images.FirstOrDefault();
}
private void OnImageSelect(ImageInfo imageInfo)
{
_selectedImage = imageInfo;
}
}namespace RazorLibrary.Components.Images;
/// <summary>
/// Information about an image, including the source URL and alt text.
/// </summary>
/// <param name="Src">The image source URL. Required.</param>
/// <param name="Alt">The image alt text. Optional.</param>
public record ImageInfo(string Src, string? Alt = null);The sample code uses the MagnifiableImage component, which is another feature request. The MagnifiableImage component can be replaced with a img element.
Using the TelerikTabSrip, If the first tab is not visible when rendered, the tab content for all tabs doesnt render.
Replicated here https://blazorrepl.telerik.com/cpEWGOPk22VW8be254
If you change the code to make the first tab visible, all is well.
You can make other tabs invisible, and all is well.
I'm looking for what you have in WPF as we migrate ourselves over to Blazor - https://www.telerik.com/products/wpf/conversational-ui.aspx
---
ADMIN EDIT
For the time being, you can consider using the Kendo Chat widget as described in this sample project.
---
TelerikDateInput control works fine in windows (browsers chrome and edge) and android (chrome)
on iPhone (safari) the page jumps to top every time after user provides a value for day, month or year.
code:
see video attached
Hello,
We are looking to port an angularjs web application to Blazor and I didn't see the diagram component similar to the one found in Kendo UI. It would be nice to see a viso-like component in UI for Blazor.
Thank you.
I'd like to use the adaptive rendering but I also need to keep AllowCustom feature.
===
ADMIN EDIT
===
This request applies to all components that support AllowCustom feature and adaptive rendering: for example, ComboBox, MultiColumnComboBox.
I've noticed this warning is now shown since version 9.0.0. I checked the release notes and don't see any notes reflecting this change. I also checked the documentation and don't see any information about the OnUpdate event. Can we please update the documentation to document the changes? I would like to understand the behavior of OnUpdate so I can move away from ValueChanged.
"warning CS0618: 'TelerikFilter.ValueChanged' is obsolete: 'Use OnUpdate instead.'"
Hello:
I am using column menu in a gantt component. In version 8.1.1 the selection of columns to display was working correctly, but when upgrading to version 9.0.0 I get an error using the same implementation. The error received is:
blazor.web.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.Blazor.Components.Common.ColumnMenu.ColumnMenu`1.<OnColumnChooserColumnVisibilityChange>d__188[[BlazorRepl.UserComponents.__Main.FlatModel, BlazorRepl.UserComponents, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
at Telerik.Blazor.Components.Common.ColumnMenu.ColumnMenuChooser.OnApplyClick()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)You can replicate the error from online examples just by adding or removing visible columns.
https://www.telerik.com/blazor-ui/documentation/components/gantt/gantt-tree/columns/menu
I need to use this functionality with Telerik® UI for Blazor version 9.0.0.
When is it planned to solve this error? Is there a workaround I can apply?
Regards.
I would like to have possibility to put sorting and filtering icons in second row or at least second line in TelerikGrid header. To follow our project design I need to have 1 header row with header titles, and second row with sorting and filtering. Or at least one table header row with sorting and filtering icons in 2 line. Is this somehow possible to achieve?
Creating a new WebApp project template through the extension fails to build. This is caused by incorrect icon type in the MainLayout.razor file.
To make sure the app is correctly built, the Icon type should be FontIcon.
<TelerikButton Icon="@FontIcon.Menu"
FillMode="@ThemeConstants.Button.FillMode.Clear"
OnClick="@( () => DrawerExpanded = !DrawerExpanded )" />It appears there are some issues with encoding special characters in the DataSourceExtensions.ToODataString extension method.
See snippet below.
var ds = new DataSourceRequest()
{
Filters = [new FilterDescriptor("FieldName", FilterOperator.IsEqualTo, "Route #")],
Sorts = []
};
{
Console.WriteLine(ds.ToODataString());
$count=true&$filter=(FieldName%20eq%20%27Route%20#%27)&$skip=0
This results in a malformed url as the last part of of the query is interpreted as a fragment due to this character not being encoded.
I have a scenario in which we have user definable columns for a grid, including hundreds if not thousands that need to be ported from the old version of our product. This means these column keys would be strings that may contain spaces or even special characters - and as such cannot be a valid C# property name (which means using an ExpandoObject approach will not work)
It would be really beneficial if the TelerikGrid component could be given Data of an IEnumerable<Dictionary<string, object>> where the Field property of GridColumn (or a new property) would line up with a key in that dictionary rather than a field name for the component to then use reflection with.
A customer with multiple modules of our product installed may very well have columns with similar names, i.e "Some Key", "SomeKey", "Some_Key", "Some & Key" - so simply replacing spaces or special characters may not always still give unique keys.
Hi,
Are you planning to add a loader to the grid in the feature?
E.g as an isLoading attribute or exepnd the build-in one?
With method OnRead to fetch data, when grid is not yet loaded with data, it displays no records available.
Also when chenging data, loading is not starting, but there is an unsmooth transition after some time.
Thanks in advance for your time, Kacper
We are using Telerik UI for Blazor (V6.2.0) grid. The first 3 columns (Delivery No, Spot Check, Spotcheck Status) of the grid are frozen/locked. While horizontal scrolling the header text gets overlapped. We have used custom CSS to change the header color.
<TelerikGrid @ref="@GridRef" Data="@dashboardData"
Reorderable="true"
SortMode="@SortMode.Single"
Pageable="true"
FilterMode="GridFilterMode.FilterRow"
PageSize="10"
EnableLoaderContainer="true"
Sortable="true" Context="inboundContext" OnRowRender="@OnRowRenderHandler" Width="1800px" Height="500px">