The null type of operator can cause errors on the backend
*** Thread created by admin on customer behalf ***
Hi,
I have found a bug with the TelerikNumericTextBox in that it doesn't function correctly with nullable types (at least it doesn't with Nullable<int>). I have confirmed this is the case for both 2.28 and 2.29 versions of Kendo for Blazor.
If "TelerikNumericTextBox" is "@bind-Value" to a nullable int, the control exhibits some unusual behaviour. If you manually type 0 into the control, it is accepted and the value updates the view-model property. However, if you use either the down-arrow button or arrow keys to select 0 (on a fresh load so there is no existing value selected/set), it does not set/update the view-model property. However, it does work correctly if you select another value first (such as 1) and then select 0.
Unfortunately, this is confusing the end-users of my application and I believe it is a bug (I haven't noticed this when using the Kendo for Angular or Kendo for JQuery).
In my application, I need users to be able to set the value of 0 but we do not want to set an initial value for the NumericTextBox to be 0 as this could lead our customers on; the application in question is requiring the end-user to manually select the number rather than allowing them to just leave it as default. Therefore, the view-model property I am binding to has been put as "int?" so that the default value is null and validation will require the user to select a valid value if they just try and press save without making any changes. Please note, for our use case, the number 0 is a valid option!
Use the following razor HTML
The new value is: @TheValue
<TelerikNumericTextBox Format="D" Max="10" Min="0" Step="1" @bind-Value="@TheValue"></TelerikNumericTextBox>
@code {
public int? TheValue { get; set; }
}
Click into the control and either press "down" on the keyboard arrow keys or press the "down" icon next to the control, so the value is set to be 0. The number 0 will not be set/persisted to the view-model property even though the control shows a 0 value.
If you have multiple controls on the page, following the above steps will mean that as soon as you click into another control, 0 is deleted (I believe because the VM prop has not been set), this does not happen if you type 0 into the control.
HOWEVER
If you continue to use the same Razor code above and any of the following workflows, it will set the controls view-model property correctly:
I have attached a sample project where I have replicated the issue, it is just a simple NET5 WASM Blazor project (generated from the default template) and I have just added the latest Kendo for Blazor. Nothing else has been done except for demoing on the "index.razor" both binding approaches I have tried/been able to replicate this issue on.
I hope the above makes sense, let me know if you need any further clarification.
Hi Telerik team,
When I want to bind the Blazor Grid to an ExpandoObject I need to assign the FieldType. I know I have to use non-nullable types.
But I want to use nullable types (for example int?) to have a blank cell within the Grid when there is no value for it. With "typeof(int)" instead of "typeof(int?)" every empty cell shows "0" which I don't want.
Is there any chance to let FieldType accept nullable types?
Best regards,
Rayko
When I assign an Id to a FormGroup in TelerikForm, it's value can be seen in code, but neither the attribute nor it's value get rendered.
When the MultiColumnComboBox columns are rendered with a foreach loop, the component doesn't remove columns that are no longer defined.
The workaround is to recreate the MultiColumnComboBox: https://blazorrepl.telerik.com/wSOIvzvR46lEZrwy43
There is a change in the Grid behavior from version 4.6.0 to 5.0.0.
Consider the following REPL test page: https://blazorrepl.telerik.com/cSabmRPy306iPiXK18
Clicking on a Grid cell for editing will not open it for editing if there is already an open cell in edit mode on the same table row. The issue is reproduced more easily if the OnUpdate handler is empty or not defined at all.
This used to work in version 4.6.0.
Hey Telerik team,
We encountered issue with DateTime picker which I was able to reproduce in your Documentation preview.
If you hover over the date time dropdown, but really slowly it bugs out and the view becomes unusable like this:
As you can see, the dropdown is messed up and it seems like the hover over the border is trying to trigger some action to change from date to time pick automatically
Jakub
When I updated to the latest version I noticed that the FormItems in AuthorizedViews were moved to the bottom of the form, Quick example:
<TelerikForm>
<FormItems>
<AuthorizeView>
<Authorized>
<FormItem Field="First"/>
</Authorized>
</AuthorizeView>
<FormItem Field="Second"/>
</FormItems>
</TelerikForm>
will end up like
<TelerikForm>
<FormItems>
<FormItem Field="Second"/>
<FormItem Field="First"/>
</FormItems>
</TelerikForm>
I have a TelerikGrid with Reordarable enabled inside of a TelerikWindow. Reordering of the column works fine only the drop clue is not showing. I think this is because the z-index is incorrect.
Missing drop clue:
z-index of drop clue is 10000:
z-index of window is 10002:
It seems that the issue appeared after upgrading to Telerik 5.0 from 4.6.
When using a Grid with a locked column and column virtualization enabled, focusing cell from that locked column breaks the layout on horizontal scrolling.
I have set a small size to the MultiSelect. I noticed that the Summary Tag that contains the "1 more selected" text does not change - its size always remains the same regardless of the component size.
Reproduction: https://blazorrepl.telerik.com/cxFvPxvh58SMoekS04.
The Roundness setting of the MultiSelect also does not affect the summary tag.
---
ADMIN EDIT
Attached to this post are a reproducible and a workaround - setting the state in OnAfterRenderAsync with a small delay, so the initial grid render happens, then it can re-render and take the filters into account.
---
I've made a simple blazor repl demo here: https://blazorrepl.telerik.com/mmlYatun39gTFEgO21
As you can see, TotalCount is 10, and the current PageSize is also 10. When these values match, the value in the "items per page" dropdown isn't present. Select any other value, and it will be present (for 5, 20, 40). Come back to 10, and again, the value disappears.
Hello,
A Date/Time Picker is bound to a nullable DateTime value. If the user clears the value with the keyboard, the component will show as invalid (with red border). Instead, the picker should treat null values as valid.
Here is a test page with a few different workarounds:
<TelerikButton OnClick="@( () => DateValue = null )">Clear Value</TelerikButton>
<TelerikButton OnClick="@( () => DateValue = DateTime.Now )">Set Value</TelerikButton>
DateValue.HasValue: @DateValue.HasValue
<p>Default behavior:</p>
<TelerikDatePicker @bind-Value="@DateValue"
Width="200px" />
<p>Red border will disappear after blur (CSS):</p>
<TelerikDatePicker @bind-Value="@DateValue"
Width="200px"
Class="@( !DateValue.HasValue ? "valid-null" : "" )" />
<p>Red border will never appear (CSS):</p>
<TelerikDatePicker @bind-Value="@DateValue"
Width="200px"
Class="valid-null" />
<p>Red border will disappear after blur (OnChange):</p>
<TelerikDatePicker @bind-Value="@DateValue"
Width="200px"
OnChange="@OnPickerChange" />
<style>
.k-input.k-invalid.valid-null {
border-color: rgba(0, 0, 0, 0.08);
}
</style>
@code {
private DateTime? DateValue { get; set; } = DateTime.Now;
private async Task OnPickerChange(object newValue)
{
DateTime? newDate = (DateTime?)newValue;
if (!newDate.HasValue)
{
DateValue = DateTime.Now;
await Task.Delay(1);
DateValue = null;
}
}
}
In a Grid loaded with data made of ExpandoObject, set an aggregate GridAggregateType.Sum breaks the grouping feature while GridAggregateType Max, Min and Count work properly
Please find the attached project: in the grid on Index.razor grouping does not work, just comment Index.razor:43 to restore grouping feature
Exception message:
Error: System.InvalidOperationException: No generic method 'Sum' on type 'System.Linq.Enumerable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic.
at System.Linq.Expressions.Expression.FindMethod(Type type, String methodName, Type[] typeArgs, Expression[] args, BindingFlags flags)
at System.Linq.Expressions.Expression.Call(Type type, String methodName, Type[] typeArguments, Expression[] arguments)
at Telerik.DataSource.Expressions.EnumerableSelectorAggregateFunctionExpressionBuilder.CreateMethodCallExpression(LambdaExpression memberSelectorExpression)
at Telerik.DataSource.Expressions.EnumerableSelectorAggregateFunctionExpressionBuilder.CreateAggregateExpression()
at Telerik.DataSource.EnumerableSelectorAggregateFunction.CreateAggregateExpression(Expression enumerableExpression, Boolean liftMemberAccessToNull)
at Telerik.DataSource.Expressions.GroupDescriptorExpressionBuilder.<ProjectionPropertyValueExpressions>b__39_0(AggregateFunction f)
at System.Linq.Enumerable.SelectIListIterator`2.ToList()
at Telerik.DataSource.Expressions.GroupDescriptorExpressionBuilder.CreateProjectionInitExpression()
at Telerik.DataSource.Expressions.GroupDescriptorExpressionBuilder.CreateAggregateFunctionsProjectionMemberBinding()
at Telerik.DataSource.Expressions.QueryableAggregatesExpressionBuilder.CreateMemberBindings()+MoveNext()
at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items)
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source)
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at System.Dynamic.Utils.CollectionExtensions.ToReadOnly[T](IEnumerable`1 enumerable)
at System.Linq.Expressions.Expression.MemberInit(NewExpression newExpression, IEnumerable`1 bindings)
at Telerik.DataSource.Expressions.GroupDescriptorExpressionBuilder.CreateSelectBodyExpression()
at Telerik.DataSource.Expressions.GroupDescriptorExpressionBuilder.CreateSelectExpression()
at Telerik.DataSource.Expressions.GroupDescriptorExpressionBuilderBase.CreateQuery()
at Telerik.DataSource.Extensions.QueryableExtensions.Aggregate(IQueryable source, IEnumerable`1 aggregateFunctions)
at Telerik.DataSource.Extensions.QueryableExtensions.CreateDataSourceResult[TModel,TResult](IQueryable queryable, DataSourceRequest request, Func`2 selector)
at Telerik.DataSource.Extensions.QueryableExtensions.ToDataSourceResult(IQueryable queryable, DataSourceRequest request)
at Telerik.DataSource.Extensions.QueryableExtensions.ToDataSourceResult(IEnumerable enumerable, DataSourceRequest request)
at Telerik.Blazor.Data.TelerikDataSourceBase.ProcessData(IEnumerable data)
at Telerik.Blazor.Components.Common.DataBoundComponent`1.ProcessDataInternal()
at Telerik.Blazor.Components.Common.DataBoundComponent`1.ProcessDataAsync()
at Telerik.Blazor.Components.TelerikGrid`1.DataBoundProcessData()
at Telerik.Blazor.Components.TelerikGrid`1.ProcessDataAsync()
at Telerik.Blazor.Components.TelerikGrid`1.ApplyFiltersAsync()
at Telerik.Blazor.Components.TelerikGrid`1.OnFilterChange(FilterDescriptorBase filter)
at Telerik.Blazor.Components.Common.Filters.TelerikFilterHeader`1.Filter(FilterDescriptor filterDescriptor)
at Telerik.Blazor.Components.Common.Filters.TelerikFilterHeader`1.OnValueChanged(Object newValue)
at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__139_0(Object state)
at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteSynchronously(TaskCompletionSource`1 completion, SendOrPostCallback d, Object state)
at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.<>c.<.cctor>b__23_0(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at Microsoft.AspNetCore.Components.Rendering.RendererSynchronizationContext.ExecuteBackground(WorkItem item)
If the PdfViewer is initialized with a default document, the display performance of this document will be a lot worse, compared to PDF documents that are loaded programmatically after the component is already on the web page.