I generated a new project using the Telerik Blazor Template for server side.
In the _Host.cshtml file on line 27 it generates the following:
<a href class="reload">Reload</a>
Should be
<a href="" class="reload">Reload</a>
Have a nice day.
Peter
For example, selecting Bootstrap-Main-Dark theme in the Project Wizard does not apply the dark mode.
===ADMIN EDIT===
For the time being, a possible workaround is to manually add class="k-body" to the <body> tag of your application. This will ensure, that the dark mode is correctly applied. This is required because, by design, the Default theme does not enable the typography system. The "k-body" class is required for the typography system to work properly on the document level and apply the predefined typography values to the page. For more detailed information, refer to Design System Documentation.
Good Morning,
I have recently started getting random and repeated Javascript errors when debugging my project using your controls for Blazor. It is completely random (sometimes happens immediately at project start, sometimes when navigating to a new page, sometimes when interacting with a control). It is ALWAYS the same error....
TypeError: Cannot read properties of undefined (reading 'visible')
Message=
Source=
StackTrace:
at __webpack_modules__.8219.constructor.onMouseEnter (https://localhost:44307/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js?v=ITaQSsBTBmdJoUpPr2KiZ7JwhfKjwa7SGa6zvlv9kkU:50:1442661)
I am using the most current version of your product. I have gone through your "Javascript Errors" page and have worked through all the suggestions. Nothing resolves it.
This is becoming a giant time sink while trying to work on a project. What can we do to get appropriate error handling on your end to prevent these issues?
Thanks
I am handling the SelecteditemsChanged event of the Grid and when an exception is thrown in its handler, the ErrorBoundarydoes not catch it.
For reference, I tried attaching the same handler to a click of a button and it is successfully caught by the ErrorBoundary in this case.
Further to issue reported in https://feedback.telerik.com/blazor/1545177-selected-items-are-not-preserved-when-loading-the-state-when-the-component-is-bound-to-expandoobjects wrt Expando Object, the column menu reset also does not work when grid is bound to Expando Object
Regards
Naved
When filtering or editing a Grid with enum data, the Name property of their Display parameter is respected.
However, in the initial view mode of the Grid the Name property is not applied and the enum values are rendered regardless of whether or not their Display parameter has a Name property defined.
==========
ADMIN EDIT
==========
In the meantime, a workaround you might try is to create a custom method to check whether Display attribute is defined and get and display its Name property, otherwise display the Enum's member name.
You can then use a Template for the column that uses enum data, cast its context to the model you are using and invoke the method on the field containing the enum. The sample below demonstrates how you can achieve this.
@using System.ComponentModel.DataAnnotations
@using System.Reflection
<TelerikGrid Data=@MyData EditMode="@GridEditMode.Inline" Pageable="true" Height="500px"
OnUpdate="@UpdateHandler" FilterMode="@GridFilterMode.FilterRow">
<GridColumns>
<GridColumn Field=@nameof(SampleData.ID) Editable="false" Title="ID" />
<GridColumn Field=@nameof(SampleData.Name) Title="Name" />
<GridColumn Field=@nameof(SampleData.Role) Title="Position">
<Template>
@{
var currentEmployee = context as SampleData;
var currentRole = GetDisplayName(currentEmployee.Role);
}
@currentRole
</Template>
</GridColumn>
<GridCommandColumn>
<GridCommandButton Command="Save" Icon="save" ShowInEdit="true">Update</GridCommandButton>
<GridCommandButton Command="Edit" Icon="edit">Edit</GridCommandButton>
</GridCommandColumn>
</GridColumns>
</TelerikGrid>
@code {
//custom method to check whether Display attribute is defined and get and display its Name property, otherwise display the Enum's member name
public string GetDisplayName(Enum val)
{
return val.GetType()
.GetMember(val.ToString())
.FirstOrDefault()
?.GetCustomAttribute<DisplayAttribute>(false)
?.Name
?? val.ToString();
}
public void UpdateHandler(GridCommandEventArgs args)
{
SampleData item = (SampleData)args.Item;
//update the view-model
var index = MyData.FindIndex(i => i.ID == item.ID);
if (index != -1)
{
MyData[index] = item;
}
//perform actual data source operations here
}
//model and dummy data generation
public class SampleData
{
public int ID { get; set; }
public string Name { get; set; }
public Role Role { get; set; }
}
public enum Role
{
[Display(Name = "Manager")]
ManagerRole,
[Display(Name = "Employee")]
EmployeeRole,
[Display(Name = "Contractor")]
ContractorRole
}
public List<SampleData> MyData { get; set; }
protected override void OnInitialized()
{
MyData = new List<SampleData>();
for (int i = 0; i < 50; i++)
{
MyData.Add(new SampleData()
{
ID = i,
Name = "name " + i,
Role = (Role)(i % 3) // just some sample to populate initial values for the enum
});
}
}
}
For God's sakes I've spent 20 minutes on your site trying to figure out how to download your demos. Every link takes me that USELESS TelererkUIForBlazorSetup.exe. Syncfusion my be the worst but at least you don't have to google something that should be so redundant it's everywhere.
I finally gave up and had to google it to find it on Github. Absolutely worst experience ever.
I would like to use the new structs that are part of .NET6 - the DateOnly and TimeOnly.
Their support should extend to all respective date and time pickers and more complex components like the Grid, Gantt, Scheduler, and other applicable components.
When viewing the documentation ( https://docs.telerik.com/blazor-ui ), it would be great to be able to run the code from my browser, just like https://www.w3schools.com/cs/index.php which allows you to run, play and preview the code from the website.
The reason this is so important is that people will be able to quickly test and try out variations of the demo code and do a quick test to see if they got it right. Right now I either have to load the demo solution, make changes, compile the entire solution just to try small changes to the sample code, and then end up corrupting the demo solution.
I think this would be a great feature for all the demos that would support it. And set you apart from your competition.
I would like the DropDownList to automatically detect the boundaries of the screen in order not to truncate items when the popup is opened.
===========
ADMIN EDIT
===========
The request is also valid for the rest of the popups including AutoComplete, ComboBox, Context Menu, MultiSelect.
This is also valid for the Window.
We find this in our infrastructure but it can be reproduced even in Telerik docs.
Docs page: https://docs.telerik.com/blazor-ui/components/grid/grouping/overview try to drop all three columns using drag and drop in sequence: Team, Name, On Vacation.
Expected sequence: Team, Name, On Vacation
Expected sequence: Team, On Vacation, Name
All Elements are always added as 1 item. It is an important feature for us, as our customers use it frequently.
===
TELERIK EDIT:
A possible workaround is to intercept the grouping and reorder the groups:
@using Telerik.DataSource
<p>Group by a third column, so that it should come last in the Group Panel:</p>
<TelerikGrid @ref="@GridRef"
Data="@GridData"
Pageable="true"
Sortable="true"
Groupable="true"
FilterMode="GridFilterMode.FilterRow"
OnStateInit="@( (GridStateEventArgs<Employee> args) => OnGridStateInit(args) )"
OnStateChanged="@( (GridStateEventArgs<Employee> args) => OnGridStateChanged(args) )">
<GridColumns>
<GridColumn Field="@nameof(Employee.Name)" />
<GridColumn Field="@nameof(Employee.Team)" />
<GridColumn Field="@nameof(Employee.Salary)" />
<GridColumn Field="@nameof(Employee.OnVacation)" />
</GridColumns>
</TelerikGrid>
@code {
private TelerikGrid<Employee>? GridRef { get; set; }
private List<Employee> GridData { get; set; } = new();
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)
});
args.GridState.GroupDescriptors.Add(new GroupDescriptor()
{
Member = nameof(Employee.OnVacation),
MemberType = typeof(bool)
});
}
private async Task OnGridStateChanged(GridStateEventArgs<Employee> args)
{
if (args.PropertyName == "GroupDescriptors" && args.GridState.GroupDescriptors.Count > 2 && GridRef != null)
{
var secondGroupDescriptor = args.GridState.GroupDescriptors.ElementAt(1);
args.GridState.GroupDescriptors.Remove(secondGroupDescriptor);
args.GridState.GroupDescriptors.Add(secondGroupDescriptor);
await GridRef.SetStateAsync(args.GridState);
}
}
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; }
}
}
When is Spreadsheet for Blazor available or can i use Kendo Spreadsheat?
Regards
Alois Seidler
Hi,
I haven't been able to find this as a request or as a topic of discussion (If it iss feel free to point me to it and close this request) but I feel the Grouping feature is limiting. If I use the group field in say the DropDownList the grouping works fine but it orders it alphabetically.
I propose adding a number of features to enhance this. The first being a GroupAscending or GroupDescending tag. Takes a boolean value and allows you to change the order to ascending (default/True) or descending (False).
The second, and more complicated feature upgrade could be a GroupOrder tag. This would take a List of the group field names ordered in the way you require and apply that order to the grouping in the DropDownList. for instance if you had the list ordered as Category 1, Category 3, Category 2 it would display the items in each grouping in that order top to bottom.
Regards,
Luke
Provide ability to define icons for input prefix and suffix. Thus, provide mechanism for built-in validation icon as well.
Example image with suffix icons to give you better perspective of the feature.
The Theme Builder contains a really nice looking Popover control, and I was a bit disappointed to discover that this doesn't seem to be documented or supported in UI for Blazor.
I realize I can probably use the Tooltip to achieve a similar effect, with two caveats:
Is there any chance a Popover control is planned for a future release?