Issue: Opening and closing a window will cause the window to reopen with each following OnClick. This seems to have been introduced with the upgrade to .net10
Code: Below is an example used on the basic Telerik Blazor template. Copy this and replace Home.razor with it.
@page "/"
<PageTitle>Telerik Blazor App | Home</PageTitle>
<div id="home-page">
<HomeSvg />
<h1>Hello, Telerik UI for Blazor!</h1>
<p>Welcome to your new Telerik Blazor app.</p>
<TelerikButton OnClick="OpenWindow1">Click Here First</TelerikButton>
<TelerikButton OnClick="OpenWindow2">Click Here Second</TelerikButton>
<TelerikButton OnClick="@(async () => {await Task.Delay(100);})">Unrelated OnClick</TelerikButton>
</div>
<TelerikWindow Visible="ShowWindow1">
<WindowActions>
<WindowAction OnClick="CloseWindow1" Name="Close"></WindowAction>
</WindowActions>
<WindowContent>
<span>Moving window now will help find this window in next step, but not necessary to replicate bug.</span>
<br />
<span>Close window using 'X'.</span>
</WindowContent>
</TelerikWindow>
<TelerikWindow Visible="ShowWindow2">
<WindowActions>
<WindowAction OnClick="CloseWindow2" Name="Close"></WindowAction>
</WindowActions>
<WindowContent>
<span>Window 1 shouldn't be appearing now, but it it is. Window 1 may be behind this window if you didn't drag in previous step.</span>
<br />
<span>If you close these windows, and click the 'Unrelated OnClick' button, both of these windows will reappear, despite just firing Task.Delay(100)</span>
</WindowContent>
</TelerikWindow>
<style>
#home-page {
margin-left: auto;
margin-right: auto;
max-width: max-content;
text-align: center;
font-size: var(--kendo-font-size-xl);
}
@@media (min-height: calc(56px + 50px + 400px)) {
/* header + footer + home page container*/
#home-page {
margin-top: calc(50vh - 28px - 25px - 200px);
}
}
</style>
@code {
public bool ShowWindow1 { get; set; }
public bool ShowWindow2 { get; set; }
public async Task OpenWindow1()
{
ShowWindow1 = true;
}
public async Task OpenWindow2()
{
ShowWindow2 = true;
}
public void CloseWindow1()
{
ShowWindow2 = false;
StateHasChanged();
}
public void CloseWindow2()
{
ShowWindow2 = false;
}
}
Currently, on mobile devices (where is no hover), to open the child menu you need to click/tap the parent and the only way close it afterwards is if you click away. This is not very convenient for mobile usage. I want to be able to close the child menu on click/tap of the parent as well.
When ActiveTabId is null, the TabStrip selects the first tab automatically, but does not render its content.
<TelerikTabStrip @bind-ActiveTabId="@TabStripActiveTabId">
<TabStripTab Title="First" Id="t1">
First tab content.
</TabStripTab>
<TabStripTab Title="Second" Id="t2">
Second tab content.
</TabStripTab>
<TabStripTab Title="Third" Id="t3">
Third tab content.
</TabStripTab>
</TelerikTabStrip>
@code {
private string? TabStripActiveTabId { get; set; }
}
The ability to choose which options to appear in the ContextMenu.
=====
TELERIK EDIT: In the meantime, here is how to hide context menu items with CSS:
/* Hide the Rename item in the FileManager context menu */
.k-context-menu:has(.k-svg-i-download) .k-menu-item:nth-of-type(1) {
display: none;
}
/* Hide the Delete item in the FileManager context menu */
.k-context-menu:has(.k-svg-i-download) .k-menu-item:nth-of-type(3) {
display: none;
}Here is a complete example: https://blazorrepl.telerik.com/cpPkuBEq408A36p010
Set the PdfViewer document (data) value to null. As a result, an endless loader will appear.
===
ADMIN EDIT
===
A possible workaround for the time being is to re-initialize the component after clearing the file: https://blazorrepl.telerik.com/cHYwQola24zzBOAd02.
Hi,
The ask is for a feature request to take the already wonderfully done globally applied filter features down to a per column basis without the overhead and burden of resorting to the custom FilterMenuTemplate approach.
The current way of doing business creates much overhead in code particularly when several columns are involved.
Something like:
<TelerikGrid Data="@MyData"
FilterMode="@GridFilterMode.PerColumn"
<GridColumns>
<GridColumn Field="MyField01" FilterMode="@GridFilterColumnMode.FilterRow" />
<GridColumn Field="MyField02" FilterMode="@GridFilterColumnMode.FilterMenu" />
<GridColumn Field="MyField03" Filterable="false"/>
etc..
</GridColumns>
</TelerikGrid>
Thanks!
Ron
Hello,
I need to be able to set the colors of x-axis category labels conditionally. My current use case for this is that I'm displaying dates and need weekends and holidays to be their own colors. As far as I'm aware this cannot be accomplished in any way currently:
The two solutions I could suggest are as follows:
Thanks,
Robert
When the dropdown is open, the button's aria-controls attribute references a value that matches the popup's data-id, not its actual id. Since aria-controls must point to an element's id, the attribute is invalid and no element in the DOM matches the reference, breaking the accessible relationship between the button and its popup.
aria-controls="50dc5df2-b83e-41bd-8c34-98470aba77c6"
data-id="50dc5df2-b83e-41bd-8c34-98470aba77c6" id="8630d4e4-2f22-4eaf-b96c-7cae113b70ed"
<TelerikDropDownButton Icon="@SvgIcon.Share" OnClick="@(()=>OnItemClick("Primary"))">
<DropDownButtonContent>Share</DropDownButtonContent>
<DropDownButtonItems>
<DropDownButtonItem Icon="@SvgIcon.Facebook" OnClick="@(()=>OnItemClick("Facebook"))">Facebook</DropDownButtonItem>
<DropDownButtonItem Icon="@SvgIcon.Twitter" OnClick="@(()=>OnItemClick("Twitter"))">Twitter</DropDownButtonItem>
<DropDownButtonItem Icon="@SvgIcon.Linkedin" OnClick="@(()=>OnItemClick("Linkedin"))">Linkedin</DropDownButtonItem>
<DropDownButtonItem Icon="@SvgIcon.Reddit" OnClick="@(()=>OnItemClick("Reddit"))">Reddit</DropDownButtonItem>
</DropDownButtonItems>
</TelerikDropDownButton>DatePicker cursor not advancing after month input. The problem arises when dd/MMM/yyyy format is applied.
To reproduce the issue open this REPL example. Type any date in the second DatePicker. When inserting a month value the cursor is not moved to the year section.
After inserting a month the cursor should be moved to the year section. As when no format is applied (the first DatePicker)Goal
Our application needs to allow end users to dynamically customize the Telerik Blazor DockManager at runtime by:
These changes should be fully user-driven and persisted so that:
In short, we want the DockManager to behave as a customizable dashboard whose state can be reliably stored and reloaded from our database.
Problem
The current Telerik Blazor DockManager implementation requires panels to be declared in Razor markup (markup driven) and managed through an external data source.
This creates several challenges:
As a result, implementing a truly dynamic and persistent DockManager layout requires complex workarounds that are fragile and difficult to maintain.
Feature Request
We propose enhancing the DockManager with first-class support for dynamic panel synchronization by introducing:
Two coordinated parameters:
Expected behavior:
This would allow developers to treat the DockManager as a true data-driven component, similar to other Telerik Blazor controls, without needing to manually modify internal state structures.
The Tooltip component throws a JavaScript error when the user opens an adaptive dropdown component and tries to interact with it:
Uncaught TypeError: popup.isParent is not a function
Here is a test page. Open the DropDownList on a narrow screen and click on the adaptive ActionSheet.
<TelerikButton Class="tooltip-target" Title="Telerik Tooltip">Button</TelerikButton>
<TelerikDropDownList Data="@ListItems"
@bind-Value="@SelectedValue"
TextField="@nameof(ListItem.Text)"
ValueField="@nameof(ListItem.Id)"
AdaptiveMode="@AdaptiveMode.Auto"
Width="300px" />
<TelerikTooltip TargetSelector=".tooltip-target"
ShowOn="@TooltipShowEvent.Hover" />
@code {
private List<ListItem> ListItems { get; set; } = new();
private int SelectedValue { get; set; } = 3;
protected override void OnInitialized()
{
ListItems = new List<ListItem>();
for (int i = 1; i <= 5; i++)
{
ListItems.Add(new ListItem()
{
Id = i,
Text = $"Item {i}",
Category = $"Category {i % 6 + 1}"
});
}
base.OnInitialized();
}
public class ListItem
{
public int Id { get; set; }
public string Text { get; set; } = string.Empty;
public string Category { get; set; } = string.Empty;
}
}
How to reproduce:
The regression was introduced in version 12.2.0. The last version that works correctly is 12.0.0.
The possible workarounds are:
@using System.ComponentModel.DataAnnotations
@using Telerik.DataSource
@using Telerik.DataSource.Extensions
<TelerikGrid @ref="@GridRef"
OnRead="@OnGridRead"
TItem="@Product"
EditMode="@GridEditMode.Incell"
OnCreate="@OnGridCreate"
OnDelete="@OnGridDelete"
OnUpdate="@OnGridUpdate"
Height="600px">
<GridToolBarTemplate>
<GridCommandButton Command="Add">Add Item</GridCommandButton>
</GridToolBarTemplate>
<GridColumns>
<GridColumn Field="@nameof(Product.Name)">
<EditorTemplate>
@{ var dataItem = (Product)context; }
<span @onfocusout="@( async () => await OnGridCellFocusOut(nameof(Product.Name)) )">
<TelerikTextBox @bind-Value="@dataItem.Name" />
</span>
</EditorTemplate>
</GridColumn>
@* <GridColumn Field="@nameof(Product.Price)" DisplayFormat="{0:C2}" />
<GridColumn Field="@nameof(Product.Quantity)" DisplayFormat="{0:N0}" />
<GridColumn Field="@nameof(Product.ReleaseDate)" DisplayFormat="{0:d}" /> *@
<GridColumn Field="@nameof(Product.Discontinued)" Width="120px">
<EditorTemplate>
@{ var dataItem = (Product)context; }
<span @onfocusout="@( async () => await OnGridCellFocusOut(nameof(Product.Discontinued)) )">
<TelerikCheckBox @bind-Value="@dataItem.Discontinued" />
</span>
</EditorTemplate>
</GridColumn>
<GridCommandColumn Width="180px">
<GridCommandButton Command="Delete">Delete</GridCommandButton>
</GridCommandColumn>
</GridColumns>
</TelerikGrid>
@code {
private TelerikGrid<Product>? GridRef { get; set; }
private ProductService GridProductService { get; set; } = new();
private async Task OnGridCellFocusOut(string field)
{
await Task.Delay(100);
if (GridRef is null)
{
return;
}
GridState<Product> gridState = GridRef.GetState();
Product? editItem = gridState.EditItem as Product;
if (editItem is null)
{
return;
}
GridCommandEventArgs args = new GridCommandEventArgs()
{
Field = field,
Item = editItem
};
await OnGridUpdate(args);
gridState.EditField = default;
gridState.EditItem = default!;
gridState.OriginalEditItem = default!;
await GridRef.SetStateAsync(gridState);
}
private async Task OnGridCreate(GridCommandEventArgs args)
{
var createdItem = (Product)args.Item;
await GridProductService.Create(createdItem);
}
private async Task OnGridDelete(GridCommandEventArgs args)
{
var deletedItem = (Product)args.Item;
await GridProductService.Delete(deletedItem);
}
private async Task OnGridRead(GridReadEventArgs args)
{
DataSourceResult result = await GridProductService.Read(args.Request);
args.Data = result.Data;
args.Total = result.Total;
args.AggregateResults = result.AggregateResults;
}
private async Task OnGridUpdate(GridCommandEventArgs args)
{
var updatedItem = (Product)args.Item;
await GridProductService.Update(updatedItem);
}
public class Product
{
public int Id { get; set; }
[Required]
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public decimal? Price { get; set; }
public int Quantity { get; set; }
[Required]
public DateTime? ReleaseDate { get; set; }
public bool Discontinued { get; set; }
}
#region Data Service
public class ProductService
{
private List<Product> Items { get; set; } = new();
private int LastId { get; set; }
public async Task<int> Create(Product product)
{
await SimulateAsyncOperation();
product.Id = ++LastId;
Items.Insert(0, product);
return LastId;
}
public async Task<bool> Delete(Product product)
{
await SimulateAsyncOperation();
if (Items.Contains(product))
{
Items.Remove(product);
return true;
}
return false;
}
public async Task<List<Product>> Read()
{
await SimulateAsyncOperation();
return Items;
}
public async Task<DataSourceResult> Read(DataSourceRequest request)
{
return await Items.ToDataSourceResultAsync(request);
}
public async Task<bool> Update(Product product)
{
await SimulateAsyncOperation();
int originalItemIndex = Items.FindIndex(x => x.Id == product.Id);
if (originalItemIndex != -1)
{
Items[originalItemIndex] = product;
return true;
}
return false;
}
private async Task SimulateAsyncOperation()
{
await Task.Delay(100);
}
public ProductService(int itemCount = 5)
{
Random rnd = Random.Shared;
for (int i = 1; i <= itemCount; i++)
{
Items.Add(new Product()
{
Id = ++LastId,
Name = $"Product {LastId}",
Description = $"Multi-line\ndescription {LastId}",
Price = LastId % 2 == 0 ? null : rnd.Next(0, 100) * 1.23m,
Quantity = LastId % 2 == 0 ? 0 : rnd.Next(0, 3000),
ReleaseDate = DateTime.Today.AddDays(-rnd.Next(365, 3650)),
Discontinued = LastId % 2 == 0
});
}
}
}
#endregion Data Service
}
When you select a date in DropDownList with dates in it (List<DateTime>), the @bind-Value is shaving off the milliseconds.
===ADMIN EDIT===
In the meantime, as a workaround for displaying milliseconds correctly, you can bind the DropDownList to a model. This way, you can use the "Id" to retrieve the selected item and display its precise milliseconds. Below is an example I've prepared to demonstrate this approach:
Selected value: @myDdlData.ToList().Where(x => x.Id == selectedValueId).FirstOrDefault()?.MyValueField.ToString("MM/dd/yyyy HH:mm:ss.fff")
<br />
<TelerikDropDownList Data="@myDdlData"
TextField="MyTextField"
ValueField="Id"
@bind-Value="selectedValueId">
</TelerikDropDownList>
@code {
public class MyDdlModel
{
public int Id { get; set; }
public DateTime MyValueField { get; set; }
public string MyTextField => MyValueField.ToString("MM/dd/yyyy HH:mm:ss.fff"); // Display formatted DateTime
}
private int selectedValueId { get; set; } = 1;
private IEnumerable<MyDdlModel> myDdlData = GenerateRandomDateTimes(20);
private static IEnumerable<MyDdlModel> GenerateRandomDateTimes(int count)
{
Random random = new Random();
DateTime startDate = DateTime.Now;
return Enumerable.Range(1, count)
.Select(x => new MyDdlModel
{
Id = x, // Unique integer Id
MyValueField = startDate.AddDays(x)
.AddMinutes(random.Next(0, 60))
.AddSeconds(random.Next(0, 60))
.AddMilliseconds(random.Next(0, 1000))
}).ToList();
}
}
In a filterable Grid, if a column is not bound to a field from the model the Grid uses, it throws with:
Error: System.ArgumentNullException: Value cannot be null. (Parameter 'nullableType')
Reproduction: https://blazorrepl.telerik.com/GyEUlFEs04AUJoJ601.
The issue is reproducible :
===
ADMIN EDIT
===
A possible workaround for the time being is to set the FieldType of the column: https://blazorrepl.telerik.com/wSugvFui10jhcpZy00.