V2.23 includes the ability to fit column width to content. I can't see how to enable it. Does anyone know?
Regards,
Gerhard
Hi,
Can the DropDownList TextField property access fields on nested objects?
For example:
01.
<
TelerikDropDownList
02.
TItem
=
"PersonModel"
03.
TValue
=
"int"
04.
Data
=
"@Data"
05.
ValueField
=
"@nameof(PersonModel.PersonId)"
06.
TextField
=
"@nameof(PersonModel.Person.DisplayName)"
>
07.
</
TelerikDropDownList
>
08.
@code {
09.
private IEnumerable<
PersonModel
> Data { get; set; }
10.
11.
protected override Task OnInitializedAsync()
12.
{
13.
Data = new PersonModel[]
14.
{
15.
new() { PersonId = 1, Person = new Person { FirstName = "A", LastName = "B"}},
16.
new() { PersonId = 2, Person = new Person { FirstName = "C", LastName = "D"}},
17.
new() { PersonId = 3, Person = new Person { FirstName = "E", LastName = "F"}}
18.
};
19.
20.
return base.OnInitializedAsync();
21.
}
22.
23.
private class PersonModel
24.
{
25.
public int PersonId { get; init; }
26.
27.
public Person Person { get; init; }
28.
}
29.
30.
private class Person
31.
{
32.
public string FirstName { get; init; }
33.
34.
public string LastName { get; init; }
35.
36.
public string DisplayName => $"{FirstName} {LastName}";
37.
}
38.
}
Hi all.
I am just wondering if anyone has any ideas for making it possible to visually indicate failed validation on an Upload control?
To be clear, I have the validation working, it's just that there is no visual clue to the problem - the upload control is not highlighted like other controls are.
I looked at the example at https://github.com/telerik/blazor-ui/tree/master/upload/form-validation but even on there, you can see the issue - name and email address are highlighted but CV is not.
Any thoughts for a workaround?
Thanks,
Dean
hallo,
I wanna make appointment in calendar.
how I can do this?
Hello.
I got three charts and I want to apply the primary, secondary and tertiary colors of the selected theme respectively.
It's a silly question but I didn't figure it out. I've tried setting the Color property of the series to ThemeColors.Secondary or adding differents combinations of styles to the chart. Nothing worked properly. The only way at the moment is to set the color (rgb, hexa, etc) manually in the Color property of the series. Since the theme can be changed at runtime, I would like to use the theme colors and not have them fixed.
Any suggestion?
By the way, if a don't set the color property it gets the ThemeColors.Primary value... unfortunatelly all charts will have the same color and trying to avoid it.
Regards,
Brazorist.
Is there a way to handle @onkeydown event on <TelerikEditor>?
I tried this way:
<
TelerikEditor
Id
=
"myEditor"
@
bind-Value
=
"@myEditorValue"
@
onkeydown
=
"OnKeyDownMyEditor"
></
TelerikEditor
>
and i get the error:
blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Object of type 'Telerik.Blazor.Components.TelerikEditor' does not have a property matching the name 'onkeydown'.
System.InvalidOperationException: Object of type 'Telerik.Blazor.Components.TelerikEditor' does not have a property matching the name 'onkeydown'.
I get this kind of error any time i try to handle an event in a Telerik component using the regular Blazor way, so i guess this is not the proper way to do it.
Hello,
I have an issue with Unit tests that used to work.
I’m using bUnit to test the Blazor Autocomplete; before the (latest (not sure though)) update the tests passed.
The tests do the following:
1. bUnit renders the autocomplete
2. I use bUnit to fill in 2 chars in the autocomplete
3. The OnRead for the Autocomplete should get triggered
4. The autocomplete should than call a service method, which I mocked (using Moq)
5. I than assert the Mocked service method to be hit at least once
This used to work like a charm, but now it seems that the OnRead doesn’t get hit.
Were there any changes in when the OnRead Event gets triggered for the Autocomplete?
I decided to create a post here instead of a bUnit github issue; since the bUnit version remained the same (since the working version).
Here is some example code:
a. Component code behind:
public async Task OnRead(AutoCompleteReadEventArgs args)
{
Telerik.DataSource.FilterDescriptor filter = args.Request.Filters[0] as Telerik.DataSource.FilterDescriptor;
if (args.Request.Filters.Count < 0)
return;
string userInput = filter.Value.ToString();
if (string.IsNullOrWhiteSpace(userInput))
{
await SetToZero(); //defaults some values
return;
}
await CallService(userInput);
}
b. Component markup: <TelerikAutoComplete Data="@_data "
ClearButton="true" OnRead="@OnRead" OnChange="@OnChange"
FilterOperator="Telerik.Blazor.StringFilterOperator.Contains"
Filterable="true"
MinLength="2" //OnRead only gets hit when min 2 chars are provided
Placeholder="@PlaceHolderValue" @bind-Value="@Value"/>
c. bUnit test
Mock<InterfaceToMock> mock = new Mock<InterfaceToMock>();
mock.Setup(c => c.GetSomethingByInput(It.IsAny<string>()))
.Returns(Task.FromResult(new List<Something>()));
ctx.Services.AddScoped(sp =>
{
return mock.Object;
});
var rootComponentMock = new Mock<TelerikRootComponent>();
var cut = ctx.RenderComponent<TheComponentContainingtheAutocomplete>
(rc => rc.AddCascadingValue(rootComponentMock.Object));
cut.Find("input").Input("t");
cut.WaitForAssertion(() =>
{
//This passes
countryAutocompleteMock.Verify(m => m.GetCountriesByName(It.IsAny<string>()), Times.Never());
});
cut.Find("input").Input("tt");
cut.WaitForAssertion(() =>
{
//This fails, while it should’ve been called by the OnRead
countryAutocompleteMock.Verify(m => m.GetCountriesByName(It.IsAny<string>()), Times.Once());
});
Any idea why the OnRead doesn’t get called when 2 char input is provided in the AutoComplete within the test?
It does get called when debugging the component.
Thanks in advance!
In my grid pop-up form the validation summary looks out of place when I add my own list of errors.
I have added pictures of the code and how it looks.
Please take a look at it, looks very stranges
Hi,
We are using among other components the TreeView component for showing an hierarchical view of an organization and that works fine in most cases, there is however an issue that happens when the users are quick to navigate between views and we get an error:
crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
Unhandled exception rendering component: Cannot read property 'addEventListener' of null
TypeError: Cannot read property 'addEventListener' of null
After some investigation of the code and how the TreeView works we can see that this probably happens due to that the OnAfterRenderAsync of the TreeView runs InitTreeView which calls JSInterop to set event handling for example:
this.element.addEventListener(h, this.onKeyDown),
this.element.addEventListener(f, this.onMouseDown),
this.options.draggable && this.createDraggable()
but since this is run in OnAfterRenderAsync it may happen even after the component is disposed and removed from the DOM so the elements are no longer available and the error occurs.
Is this a known issue and is there a way to handle it?
Best regards
Johan
My tabs are taking a little of bit time to change when clicked on making it look like nothing is happening when they click on tab.
I need a way to some kind of Please Wait when a tab is clicked on and then goes away once the new tab is rendered.
I am thinking something like the three pulsing dots in the tab title while it is working.
Is there any way I can achieve this?