(bug report only)
Run the following examples and click the Export button to export the Diagram:
https://blazorrepl.telerik.com/wUutGREi32uWDUbR56
https://blazorrepl.telerik.com/GgODmnEj48uNeygS34
(optional)
The generated PDF document contains only one page and some of the Diagram shapes are not exported.
The generated PDF document contains multiple pages and all the Diagram shapes are exported.
===
ADMIN EDIT
===
For the time being, a possible option is to use the DropDownList component that exposes such events. Customize it so it can look and behave similarly to the DropDownButton.
Example implementation: https://blazorrepl.telerik.com/mekbkTPE21kwyMBU05.
Hello,
When a Grid is using multi column headers, and I add one more column in the OnBeforeExport event, this new column has no title in the exported file.
A possible workaround might be to use a column with zero Width and change the width in OnBeforeExport.
@using Telerik.Blazor.Common.Export.Excel
@using Telerik.Blazor.Components.Grid
<TelerikGrid TItem="@FlowRun"
Pageable="true"
OnRead="@GetData">
<GridToolBar>
<GridCommandButton Command="ExcelExport" Icon="file-excel">Export to Excel</GridCommandButton>
<GridCommandButton Command="CsvExport" Icon="file-csv">Export to CSV</GridCommandButton>
<label class="k-checkbox-label"><TelerikCheckBox @bind-Value="@ExportAllPages" />Export All Pages</label>
</GridToolBar>
<GridExport>
<GridExcelExport FileName="telerik-grid-export" AllPages="@ExportAllPages" OnBeforeExport="@BeforeExcelExport" />
<GridCsvExport FileName="telerik-grid-export" AllPages="@ExportAllPages" OnBeforeExport="@BeforeCsvExport" />
</GridExport>
<GridColumns>
<GridColumn Field="@nameof(FlowRun.FileName)" Title="File Name" Width="300px" />
<GridColumn Field="@nameof(FlowRun.Type)" Title="Type" Width="100px" />
<GridColumn Field="@nameof(FlowRun.FileSize)" Title="File Size" Width="200px" />
<GridColumn Title="Source">
<Columns>
<GridColumn Field="@(nameof(FlowRun.Source))" Title="MPID"/>
<GridColumn Field="@(nameof(FlowRun.SourceFileProtocol))" Title="Type" />
</Columns>
</GridColumn>
<GridColumn Field="@nameof(FlowRun.ErrorMessage)"
Title = "Error"
Width="0" />
</GridColumns>
</TelerikGrid>
@code {
bool ExportAllPages { get; set; }
private async Task GetData(GridReadEventArgs args)
{
args.Data = Enumerable.Range(1, 10).Select(x => new FlowRun
{
FileName = $"File {x}",
Type = $"Type {x}",
FileSize = x * 2,
Source = $"Source {x}",
SourceFileProtocol = FileProtocol.CIX,
ErrorMessage = $"Error {x}"
}).ToList();
args.Total = 100;
}
private void BeforeCsvExport(GridBeforeCsvExportEventArgs obj)
{
AddErrorMessageColumn(obj);
}
private void BeforeExcelExport(GridBeforeExcelExportEventArgs obj)
{
AddErrorMessageColumn(obj);
}
private void AddErrorMessageColumn(GridBeforeSpreadsheetExportEventArgs args)
{
args.Columns.Find(x => x.Field == nameof(FlowRun.ErrorMessage)).Width = "100px";
//args.Columns.Add(new ExcelExportableColumn
//{
// Field = nameof(FlowRun.ErrorMessage),
// Title = "Error"
//});
}
public class FlowRun
{
public string FileName { get; set; }
public string Type { get; set; }
public long? FileSize { get; set; }
public string Source { get; set; }
public FileProtocol SourceFileProtocol { get; set; }
public string ErrorMessage { get; set; }
}
public enum FileProtocol
{
Unknown,
PIX,
CIX,
SS
}
}
I have a Telerik Pager within a Telerik Grid. If I select a larger page size within the pager, then select a smaller size and do not scroll, the next time I open the pager, the dropdown portion opens in the wrong place. When I view the inspect tool, it appears that the CSS top value is not being updated when changing page sizes from bigger to smaller. Is this a Telerik limitation with the pager?
In the images, we select items per page from 10 to 25, and then we go immediately from 25 to 10 items per page. Without scrolling, we click into the drop down list again and we are able to replicate this issue.
Before: Items per page: 10 -> 25
After:
Thank you in advance.
When the Grid is grouped and aggregate functions are enabled, paging performance degrades significantly because grouping and aggregate calculations are executed on every page change. This results in noticeable delays and UI stutter, especially in WebAssembly applications and larger datasets.
This enhancement optimizes page navigation for grouped Grid scenarios with aggregates by avoiding repeated processing when the underlying data has not changed, resulting in substantially faster paging performance while preserving existing functionality and first-load behavior.
The Diagram's JS handle-creation logic (_createHandles) throws an exception whenever a connection has both Points.Enabled = true and Drag/Remove enabled at the same time.
A js exception is thrown: Uncaught TypeError: can't access property "radius", e.midpoint is undefined
No exception is thrown.
Workaround:
Do not set the Points property in the DiagramConnectionEditableDescriptor:
*Points = new DiagramConnectionEditablePointsDescriptor
*
Editable = new DiagramConnectionEditableDescriptor
{
Enabled = true,
Drag = true,
Remove = false
}
If using declarative shapes, remove:
<DiagramConnectionEditablePoints Enabled="true" />
from the connections.
To optimize performance, I built a custom component that allows the user to choose which aggregates should be calculated. This component ensures that <GridAggregate> tags are inserted into <GridAggregates> via a foreach loop.
This works without any issues, at least when the selection is made for the first time.
However, if a selection is made in which the column of a new aggregate appears before an already selected aggregate, errors occur in the grid. AggregateResults now contains duplicates of an existing aggregate, and the new aggregates are missing.
Test project available in ticket 1718830.
I bind the TelerikEditor Value to a property that is reloaded with different unrelated content. The editor keeps the Undo/Redo stack so for the "second" content I can Undo back to the "first" content. I'd like to be able to clear the Undo stack.
In the FileManager in a serverc app, click the New Folder button. Try to enter folder name - depending on the server-client latency, characters may be erased as you type them. The only solution in these cases is to type slower or use a custom tool to create new folders.
The problematic behavior can also be observed when attempting to rename a file or folder through the Rename command in the built-in context menu.
The Gantt Timeline header no longer scrolls horizontally together with the content below it.
The issue occurs in version 15.0.0.
A possible workaround is to enable scroll syncing with JavaScript:
https://blazorrepl.telerik.com/GqYiHFvd10Uo0MgN20
@implements IAsyncDisposable
@inject IJSRuntime JS
<TelerikGantt Data="@GanttData"
@bind-View="@CurrentView"
Class="scrollable-gantt-1"
IdField="@nameof(FlatModel.Id)"
ParentIdField="@nameof(FlatModel.ParentId)"
Width="700px"
Height="500px">
<GanttViews>
<GanttDayView></GanttDayView>
<GanttWeekView></GanttWeekView>
<GanttMonthView></GanttMonthView>
<GanttYearView></GanttYearView>
</GanttViews>
<GanttColumns>
<GanttColumn Field="@nameof(FlatModel.Id)"
Visible="false">
</GanttColumn>
<GanttColumn Field="@nameof(FlatModel.Title)"
Expandable="true"
Width="160px"
Title="Task Title">
</GanttColumn>
<GanttColumn Field="@nameof(FlatModel.PercentComplete)"
Title="Completed"
Width="60px">
</GanttColumn>
<GanttColumn Field="@nameof(FlatModel.Start)"
Width="100px"
TextAlign="@ColumnTextAlign.Right">
</GanttColumn>
<GanttColumn Field="@nameof(FlatModel.End)"
DisplayFormat="End: {0:d}"
Width="100px">
</GanttColumn>
</GanttColumns>
</TelerikGantt>
<script suppress-error="BL9992">
function initGanttScrollSync(ganttSelector) {
const ganttTimelineContent = document.querySelector(ganttSelector + " .k-gantt-timeline .k-grid-content");
if (ganttTimelineContent) {
ganttTimelineContent.addEventListener("scroll", onGanttTimelineScroll);
}
}
function disposeGanttScrollSync(ganttSelector) {
const ganttTimelineContent = document.querySelector(ganttSelector + " .k-gantt-timeline .k-grid-content");
if (ganttTimelineContent) {
ganttTimelineContent.removeEventListener("scroll", onGanttTimelineScroll);
}
}
function onGanttTimelineScroll(e) {
const ganttTimelineHeader = e.target.closest(".k-gantt-timeline").querySelector(".k-grid-header-wrap");
if (ganttTimelineHeader) {
ganttTimelineHeader.scrollLeft = e.target.scrollLeft;
}
}
</script>
@code {
private List<FlatModel> GanttData { get; set; } = new List<FlatModel>();
private List<FlatModel> Data { get; set; } = new List<FlatModel>();
private GanttView CurrentView { get; set; } = GanttView.Week;
private int LastId { get; set; } = 1;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await JS.InvokeVoidAsync("initGanttScrollSync", ".scrollable-gantt-1");
}
await base.OnAfterRenderAsync(firstRender);
}
public async ValueTask DisposeAsync()
{
await JS.InvokeVoidAsync("disposeGanttScrollSync", ".scrollable-gantt-1");
}
protected override void OnInitialized()
{
GanttData = new List<FlatModel>();
var random = new Random();
for (int i = 1; i <= 3; i++)
{
var newItem = new FlatModel()
{
Id = LastId,
Title = $"Employee {i}",
Start = new DateTime(2020, 12, 10 + i),
End = new DateTime(2020, 12, 11 + i),
PercentComplete = Math.Round(random.NextDouble(), 2),
HasChildren = true
};
GanttData.Add(newItem);
var parentId = LastId;
LastId++;
for (int j = 1; j <= 2; j++)
{
GanttData.Add(new FlatModel()
{
Id = LastId,
ParentId = parentId,
Title = $"Employee {i} : {j}",
Start = new DateTime(2020, 12, 20 + j),
End = new DateTime(2020, 12, 21 + i + j),
PercentComplete = Math.Round(random.NextDouble(), 2)
});
LastId++;
}
}
base.OnInitialized();
}
public class FlatModel
{
public int Id { get; set; }
public int? ParentId { get; set; }
public string Title { get; set; } = string.Empty;
public double PercentComplete { get; set; }
public DateTime Start { get; set; }
public DateTime End { get; set; }
public bool HasChildren { get; set; }
}
}