Hi, my goal is validate a form and focus telerik widget with validation errors.
Now i can find the element search for class "k-invalid" but how to get the widget reference so i can call the FocusAsync() method?
Thanks
I am trying to convert implement the TelerikTabStrip and was largly successful however I have a component that contains conditional logic that adds between 0 and 2 additional tabs to the parent components tabStrip. Unfortuately these tabs are not rendering correctly. I was able to replicate a minimum reproducable example in the blazor REPL environment using the following code. Are you able to advise how I can add tabs to a parents tabstrip, my two rendering issues are:
Main.razor
<TelerikTabStrip PersistTabContent="true">
<TabStripTab Title="tab1">
<p>tab1 content</p>
</TabStripTab>
<TabStripTab Title="tab2">
<p>tab2 content</p>
</TabStripTab>
<TabStripTab Title="tab3">
<p>tab3 content</p>
</TabStripTab>
<SubComponent />
</TelerikTabStrip>
SubComponent.razor
<TabStripTab Title="tab4">
<p>tab4 content</p>
</TabStripTab>
<TabStripTab Title="tab5">
<p>tab5 content</p>
</TabStripTab>
Screenshots:
initial render:
Clicking on tab 1, 2 or 3 works as expected:
clicking on 4 or 5 shows no content:
Then clicking back to 1, 2 or 3 shows 4 and/or 5 as still selected:
Severity Code Description Project File Line Suppression State
Error (active) NU1107 Version conflict detected for Telerik.Zip. Install/reference Telerik.Zip 2023.1.307 directly to project Project1 to resolve this issue.
Project1 -> Telerik.UI.for.Blazor 4.1.0 -> Telerik.Documents.SpreadsheetStreaming 2023.1.307 -> Telerik.Zip (= 2023.1.307)
Project1 -> Telerik.Documents.Spreadsheet.FormatProviders.OpenXml 2023.1.104 -> Telerik.Zip (= 2023.1.104). Project1 C:\Work\Projects\Project1 \Project1.csproj 1
My project is referenced to
<PackageReference Include="Telerik.Documents.Spreadsheet.FormatProviders.OpenXml" Version="2022.2.613" />
<PackageReference Include="Telerik.Documents.SpreadsheetStreaming" Version="2022.2.613" />
<PackageReference Include="Telerik.UI.for.Blazor" Version="3.4.0" />
But I am not able to find them in Nuget
I am working on a Blazor Auto application using the Upload component to upload images for a product for various properties in a SaaS type system.
I found that when I adjust the save point in the application at runtime the SaveUrl does not seem to retain the value.
For example:
SaveImageUrl = $"api/property/{TenantSelectionService.SelectedTenant.Id}/product-types/{TypeCode}/images";
<TelerikUpload AllowedExtensions="@(new List<string>() {".jpg", ".jpeg", ".webp" })"
SaveUrl="@SaveImageUrl"
WithCredentials="true"
OnUpload="@OnUploadAsync">
This is set in two locations, OnAfterRender as well as OnTenantSelectionChanged event.
When using this method, it appears that the Upload component does not retain the SaveUrl for some reason. When examining the JavaScript, the URL is always blank.
I did manage to alter the URL to a static version and pass data as a header.
Is this something that can be looked into or maybe I am doing it wrong.
Hi,
We've implemented group load on demand in a grid and the rows in each group are editable. Is is possible to maintain the expanded state of a group after a row has been edited?
I've amended the code in Toggle Group Load Mode at Runtime to show an example of the issue we have.
@using Telerik.DataSource
<p>
<label>
<TelerikCheckBox Value="@GridLoadGroupsOnDemand"
ValueChanged="@GridLoadGroupsOnDemandChanged"
TValue="@bool" /> Load Groups On Demand
</label>
</p>
<TelerikGrid @ref="@GridRef"
Data="@GridData"
TItem="@Employee"
Pageable="true"
Sortable="true"
Groupable="true"
LoadGroupsOnDemand="@GridLoadGroupsOnDemand"
FilterMode="GridFilterMode.FilterRow"
OnStateInit="@OnGridStateInit"
EditMode="@GridEditMode.Inline">
<GridColumns>
<GridColumn Field="@nameof(Employee.Name)" />
<GridColumn Field="@nameof(Employee.Team)" />
<GridColumn Field="@nameof(Employee.Salary)" />
<GridColumn Field="@nameof(Employee.OnVacation)" />
<GridCommandColumn>
<GridCommandButton Command="Save" Icon="@SvgIcon.Save" ShowInEdit="true">Update</GridCommandButton>
<GridCommandButton Command="Edit" Icon="@SvgIcon.Pencil">Edit</GridCommandButton>
<GridCommandButton Command="Cancel" Icon="@SvgIcon.Cancel" ShowInEdit="true">Cancel</GridCommandButton>
</GridCommandColumn>
</GridColumns>
</TelerikGrid>
@code {
private TelerikGrid<Employee>? GridRef { get; set; }
private List<Employee> GridData { get; set; } = new();
private bool GridLoadGroupsOnDemand { get; set; }
private void GridLoadGroupsOnDemandChanged(bool newValue)
{
GridLoadGroupsOnDemand = newValue;
GridRef?.Rebind();
}
private void OnGridStateInit(GridStateEventArgs<Employee> args)
{
args.GridState.GroupDescriptors = new List<GroupDescriptor>();
args.GridState.GroupDescriptors.Add(new GroupDescriptor()
{
Member = nameof(Employee.Team),
MemberType = typeof(string)
});
}
protected override void OnInitialized()
{
var rnd = new Random();
for (int i = 1; i <= 20; i++)
{
GridData.Add(new Employee()
{
Id = i,
Name = "Name " + i,
Team = "Team " + (i % 4 + 1),
Salary = (decimal)rnd.Next(1000, 3000),
OnVacation = i % 3 == 0
});
}
}
public class Employee
{
public int Id { get; set; }
public string Name { get; set; } = string.Empty;
public string Team { get; set; } = string.Empty;
public decimal Salary { get; set; }
public bool OnVacation { get; set; }
}
}
We currently have a legacy MVC application that we want to migrate to Blazor WebAssembly.
One of our problems is that, when using navigation to route to a MVC page via NavigationManager (which is done everywhere by Telerik UI), Blazor WebAssembly routes internally to NotFound. We would like to override that behaviour but are facing some issues:
1. We tried overriding the Telerik UI behaviour by overriding the onselect handler on some components (i.e. Drawer). While that works fine not every component that does routing seems to have a corresponding overridable event.
2. We tried overriding the navigation event globally using NavigationManager.RegisterLocationChangingHandler to cancel the navigation event and emit a new one (with forceLoad set to true). This seems to not work. Here is the code of our handler. It is getting called and the event is also cancelled just fine. It just seems that the forceLoad does not get respected in that case:
private ValueTask OnLocationChanging(LocationChangingContext context)
{
if (BlazorPages.Internal.Contains(context.TargetLocation))
{
return ValueTask.CompletedTask;
}
if (Uri.TryCreate(context.TargetLocation, UriKind.Absolute, out Uri? _))
{
return ValueTask.CompletedTask;
}
context.PreventNavigation();
NavigationManager.NavigateTo(context.TargetLocation, forceLoad: true);
return ValueTask.CompletedTask;
}
3. We tried using anchor tags for routing. While that works fine it is really much work to implement this into every component that is getting used. While components can be made reusable we'd have to re-template some others every time since you can't just copy-paste them from the source project. There is not just that problem but also that anchor tags break the styling at every component that I tried until now and we have to style them correctly which also consumes much time.
So, the question here is: What is the correct way to handle this use case? Do we really have to rewrite most components that include anchor tags? Is there maybe an alternating Telerik UI version that actually uses anchor tags instead of programmatical routing (which would be really nice since we would get things like right click to open new tab features)?