Hello
We have added validation to the Grid using Fluent Validation and this works perfectly. However in the validation we have to go to a back-end API to check if the value is not a duplicate.
The current behavior is that the Fluent Validation goes off whenever you type, this causes a lot of load on the API. Is there a way to change this? Maybe so it only occurs when you press the Save button, or when you leave the input field, or after x seconds of no typing...
Another valid option would be to do the check in the Update or Create Handler, but how do we display a nice error message that way to the user?
Thank you in advance
Thomas
Opening the page it return this error on chrome console:
System.AggregateException: One or more errors occurred. (Could not load list of method overrides due to Method not found: System.Collections.Generic.IList`1<Microsoft.Extensions.Configuration.IConfigurationSource> Microsoft.Extensions.Configuration.IConfigurationBuilder.get_Sources())
---> System.TypeLoadException: Could not load list of method overrides due to Method not found: System.Collections.Generic.IList`1<Microsoft.Extensions.Configuration.IConfigurationSource> Microsoft.Extensions.Configuration.IConfigurationBuilder.get_Sources()
at Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHostBuilder.CreateDefault(String[] args)
at BlazorRepl.Client.Program.Main(String[] args)
--- End of inner exception stack trace ---
callEntryPoint @ blazor.webassembly.js:1
VM262:1 Uncaught ReferenceError: webVitals is not defined
at <anonymous>:1:313
at gtm.js?id=GTM-6X92:502:414
at HTMLScriptElement.<anonymous> (gtm.js?id=GTM-6X92:503:118)
I have a grid defined with SelectionMode="GridSelectionMode.Single". I'm handling the SelectedItemsChanged event and when returning the previously selected row is selected with the newly selected row. This appears to be happening when an async call to a web api using http client is made. If I comment out the http call the selection works as expected.
Can someone explain why the http client call could be impacting the selection functionality or how I may go about debugging this?
<div ><div ><label for="label">Labels</label><div ><TelerikGrid Data="@Labels"
FilterMode="@GridFilterMode.FilterRow"
ScrollMode="GridScrollMode.Scrollable"
SelectionMode="GridSelectionMode.Single"
SelectedItems="@SelectedLabels"
SelectedItemsChanged="@((IEnumerable<LabelDto> labelList) => OnSelectAsync(labelList))"
Height="200px"><GridColumns><GridColumn Field="@(nameof(LabelDto.Name))"></GridColumn></GridColumns></TelerikGrid></div></div></div>
public partial class LabelSelection
{
private ObservableCollection<LabelDto>? _labels;
private int? _selectedValue;
public IEnumerable<LabelDto> SelectedLabels { get; set; } = Enumerable.Empty<LabelDto>();
protected async Task OnSelectAsync(IEnumerable<LabelDto> labels)
{
var l = labels.ToList();
SelectedLabels = l;
if (l.Any())
await LabelChangedAsync(l[0]);
StateHasChanged();
}
...
}
public async Task LabelChangeHandlerAsync(LabelDto label)
{
_currentLabel = label;
var labelWithAttributes = await LabelRepo.GetLabelAsync((int)label.Id);
//LabelAttributeList.Clear();
//if (labelWithAttributes.Attributes.Any())
//{
// LabelAttributeList.AddRange(labelWithAttributes.Attributes);
//}
}
public async Task<LabelWithAttributesDto> GetLabelAsync(int id)
{
var req = $"labels/{id}?includeAttributes=true";
_logger.Log(LogLevel.Warning, $"GetLabelsAsync({_client.BaseAddress}{req})...");
// The next call will cause multiple rows to be selected. Commenting this out will make the selections work.
var apiResponse = await _client.GetStreamAsync(req);
//_logger.Log(LogLevel.Warning, $"...back from GetLabelsAsync({_client.BaseAddress}{req})");
//var label = await JsonSerializer.DeserializeAsync<LabelWithAttributesDto>
// (apiResponse, new JsonSerializerOptions() { PropertyNameCaseInsensitive = true });
//return label;
return new LabelWithAttributesDto(1, "new", "filename", "100", new List<LabelAttributeDto>());
}
I want to make a Custom GridCommandbutton Visible based on a value in the row.
For example, if the Status column of a row is 2, I want the command button to be visible, otherwise I want it hidde.
Is this possible?
Started seeing errors after updated V.S. Pages that uses TelerikGrid has these 2 errors. It compiles fine and run fine, so i'm not sure how to fix.
Error (active) CS1503 Argument 2: cannot convert from 'Microsoft.AspNetCore.Components.EventCallback<System.Collections.Generic.IEnumerable<mymodel>>' to Microsoft.AspNetCore.Components.EventCallback'
Error (active) CS0246 The type or namespace name 'TItem' could not be found (are you missing a using directive or an assembly reference?)
Please advise
Thanks, ZB
Hi all,
I'm having a hard time implementing a DateTime picker in a Grid. I'd like to set up the grid using the hierarchy feature and implement InCell editing. I created a version of my problem in the Telerik REPL and have observed the same issue in my current code.
https://blazorrepl.telerik.com/wmEfuDcn54Cv6ZNO07
As you can see, the DateTime picker works fine in the parent table. But when it is implemented in the child table, it seems that clicking on the DateTime picker actually takes the cell out of focus.
Does anyone know if there is a workaround or if this is a bug?
Thanks
Edit: I added the screenshots when I noticed that the REPL link wasn't loading correctly on my Chrome or Edge browser
Hello, I seem to be having an issue regarding the Telerik DropdownLists.
Any dropdown list that has its values loaded from the database, displays empty, regardless of whether the property bound to the value has anything it or not. It's specially confusing, when the bound property has a correct value, yet it still displays empty.
This issue seems to be exclusive to the loaded from database values, as anything locally added, seem to work in the same manner.
We are currently using version 2.3.X, but we are unable to update due to styling breaking.
Hi, if i set the property Enabled="false" the component is grayed but i can still change the selected item from ui.
It's a bug?
I would like to disable dropdownlist to be opened or to be selectable from the user.
Thanks
Is there any way to allow a form group to span multiple rows within the form? So i could make my form look like the image below