If the Datepicker's binded value is a DateOnly type, the Min and Max should follow that type.
Hi,
As the subject says, when our app is on the Chinese localization `zh-CN` it causes the date picker to default.
By default I mean the default date becomes 01 01 0001 and you cannot change it no matter what you select.
On any of our other localizations such as es-ES, en-US, fr-FR, etc. (zh-CN is the only one is what I'm getting at) we don't get this issue.
I use TelerikMultiSelect as a component for custom filter:
<FilterMenuTemplate>
<TelerikMultiSelect Value="@(AlreadySelectedFilterValues(context.FilterDescriptor))"
OnRead="@OnReadWrapper"
ValueMapper="@ValueMapperWrapper"
TItem="@FilterItemDto"
TValue="@TFilterValue"
ValueField="@nameof(FilterItemDto.Id)"
TextField="@nameof(FilterItemDto.Name)"
AutoClose="true"
Filterable="true"
ClearButton="true"
DebounceDelay="500"
OnChange="@((object newValue) => OnMenuFilterChange(newValue, context))"/>
</FilterMenuTemplate>
Trying to render already selected filters gives two "magic" items in context.FilterDescriptor in AlreadySelectedFilterValues:
These items appear only if TelerikMultiSelect is empty. If I select some from MultySelect these two items disappear and everything works as expected.
GridState has an empty list of FilterDescriptos.
AggregatedAccountNames - string? column.
TFilterValues can be int, int? or string, no matter, the same behavior.
TFilterItemDto - class with int? Id and and string Name fields.
As expected value I expect to have empty FilterDescriptos if nothing was selected.
Please consider refactoring Telerik.DataSource to allow for Dynamic Linq expressions rather than fixed Member.
1. You don't have to reinvent the wheel in creating lambda expressions. You can simplify Telerik.DataSource code to just use Dynamic Linq.
2. Allows support for Sorts & Grouping to be expressions such as "Math.Abs(field ?? 0)" rather than just "field".
We have edit dialogs with editable fields on them, and we want to display a confirmation dialog if the user tries to close the edit dialog without saving. Simplified code to illustrate the issue:
Sometimes we need custom filter logic.
The advised approach currently is to use the OnRead event and have to manage the fetching of data manually https://docs.telerik.com/blazor-ui/components/grid/manual-operations
If we could set a column to use a filter function that has Func<GridDataType, Bool>? then we could apply this complex filter without having to repeatedly query the database and apply filters server side.
For example, if I wanted to filter a column that related to an object that had a property that was a Collection<T> I could check the values of this collection against a filter UI I have made somewhere in the grid or outside of it. Then when the columns filterdescriptior was reviewed it would check my Func which returned True if any of the Rows Collection<T> matched my custom filter UI options.
Example use case that this feature would allow;
For reasons unknown, our TelerikGrid rows all render with each <tr> element having the "k-alt k-table-alt-row" classes associated with them. This causes the background colour for each row to be the same, rather than alternating between two colours.
For example, the following block of code...
<TelerikGrid Id="@(Utility.CleanCssId("CrewGrid"))"
DetailTemplate="GridDetailTemplate"
EnableLoaderContainer="@ShowLoading"
Groupable="false"
Height="100%"
OnRead="@OnGridRead"
OnStateChanged="@OnGridStateChanged"
OnStateInit="@OnGridStateInit"
Pageable="true"
PageSize="@PageSize"
PageSizeChanged="@OnGridPageSizeChanged"
Reorderable="IsLargeScreen"
Resizable="IsLargeScreen"
SelectionMode="GridSelectionMode.Single"
ShowColumnMenu="IsLargeScreen"
Size="@GetGridSize"
Sortable="true"
SortMode="SortMode.Multiple"
TItem="CrewListItem"
@ref="Grid"
@bind-SelectedItems="@SelectedItems"
OnRowRender="OnRowRender">
<NoDataTemplate>
<strong>@RecordsMessage</strong>
</NoDataTemplate>
<GridSettings>
<GridColumnMenuSettings Lockable="false" FilterMode="ColumnMenuFilterMode.None" />
<GridPagerSettings InputType="PagerInputType.Buttons" PageSizes="@PageSizes" ButtonCount="5" Adaptive="false" Position="PagerPosition.Bottom" />
</GridSettings>
<GridColumns>
<GridColumn Field="@nameof(CrewListItem.Color)"
Width="@(IsLargeScreen ? "40px" : "50px")"
Resizable="false"
ShowColumnMenu="false"
Groupable="false"
ShowColumnChooser="false"
Sortable="false"
HeaderClass="k-text-transparent"
OnCellRender="OnGridCellRender">
<Template>
@{
var item = (CrewListItem)context;
<M360ListColumnColor Color="@item.Color" IsLargeScreen="IsLargeScreen" />
}
</Template>
</GridColumn>
<GridColumn Field="@nameof(CrewListItem.Name)" Title="@TMessages.Crew" OnCellRender="OnGridCellRender" VisibleInColumnChooser="false">
<Template>
@{
var item = (CrewListItem)context;
<div class="k-d-flex k-h-full @(IsLargeScreen ? "k-align-items-stretch" : "k-align-items-center")">
<M360ListColumnLink Url="@string.Concat("crew/", item.Id)" Text="@item.Name" EntityType="Crew" IsPrimary="true" />
</div>
}
</Template>
</GridColumn>
<GridColumn Field="@nameof(CrewListItem.DivisionsJson)" Title="Division(s)" Sortable="true" Visible="IsLargeScreen" OnCellRender="OnGridCellRender">
<Template>
@{
var item = (CrewListItem)context;
<M360ListColumnList Items="@item.Divisions.ToList()" />
}
</Template>
</GridColumn>
.
.
.
</GridColumns>
</TelerikGrid>
...results in markup like this...
<tbody class="k-table-tbody" role="rowgroup">
<tr
role="row"
class="k-master-row k-table-row k-alt k-table-alt-row"
data-render-row-index="0"
aria-rowindex="1"
>
. . .
</tr>
<tr
role="row"
class="k-master-row k-table-row k-alt k-table-alt-row"
data-render-row-index="1"
aria-rowindex="3"
>
. . .
</tr>
<tr
role="row"
class="k-master-row k-table-row k-alt k-table-alt-row"
data-render-row-index="2"
aria-rowindex="5"
>
. . .
</tr>
. . .
</tbody>
I can see that the "aria-rowindex" increments by two, yet the "data-render-row-index" increments by one. Are we missing something simple, yet crucial here? What could cause the skipping of rows during render?
Many thanks,
Nem
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
Hi,
I have a little problem with changing the LoadGroupsOnDemand value. Depending on the data in my grid, I set this value to true or false. When updating grid data requires changing the LoadGroupsOnDemand value, I can't do it this way:
LoadGroupsOnDemand = true;
GridData = result;
GridRef.SetStateAsync(GridRef.GetState());
This code throws me an exception.
I need to do something like this to make it work:
LoadGroupsOnDemand = true;
GridRef.LoadGroupsOnDemand = LoadGroupsOnDemand;
GridData = result;
GridRef.SetStateAsync(GridRef.GetState());
This is the code that is executed in onclick. After OnRead is executed, the exception is thrown.
Let me know if you need more information.
See below repl
https://blazorrepl.telerik.com/GeYodYvp135zJH7N22
The first dropdown is populated correctly, it is not in a FormItem or Template
The second one, populated in the same way but inside a FormItem context does not show the data, it only redraws and shows data when entering another control i.e. the other working dropdown.
This was previously working when the application was using .net 6 and Telerik 3.6.1
It has since been updated to .net 8 and Telerik 5.1.1
What is the correct way to populate this?
Can you provide more information?
Thanks.
Currently using Telerik.DataSource.QueryableExtensions.CreateDataSourceResult() results in queryable.Count() + queryable.Skip(...).Take(...). done seperatelly. EF Core specific tests are already present it seems, based on decompiled code, I can see: "if (!sort.Any() && queryable.Provider.IsEntityFrameworkProvider())".
Request: Add support for other ORM's that are more capable than EF Core. In case of pagination, window-function could be used to save from extra count query. A short sample bellow:
var dbResults = await queryable
.Select(x => new {
Item = x,
TotalCount = Sql.Ext.Count().Over().ToValue()
})
.Skip(() => offset)
.Take(() => limit)
.ToListAsync();
var count = dbResults.FirstOrDefault()?.TotalCount ?? 0;
var items = dbResults.Select(x => x.Item);
Read more about Window functions: https://statics.teams.cdn.office.net/evergreen-assets/safelinks/1/atp-safelinks.html
Hi,
Here is my demo DatePicker Demo
In Firefox, after I use the mouse to black all texts out, then DatePicker only selects the month field in the place holder. I expect to select all texts.
In Chrome or Edge, the DatePicker works as expected, after blacking texts out, it selects all texts in the place holder
Could you please check the issue?
Thanks and regards,
Tung
I just spent hours trying to understand why my grid did not work and threw a "source can't be null" exception at me when I set data to a 100% initialized - not null - list of a struct type.. Eventually I figured that the struct was the problem and turning it into a class fixed it, but that was just by chance.
Please for the sake of developer sanity give this a proper check.
Hi Telerik Team,
when using the (currently) latest versions of VS (17.11.0) and Blazor 8.0.8 runtimes (and custom css theme version 8.2.0) I get the following error when running my project in debug mode:
TypeError: Cannot read properties of null (reading 'classList')
Stapelüberwachung:
> at e.addClass (https://localhost:7038/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:50:1122923)
> at v.resetCallout (https://localhost:7038/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:50:1372516)
> at v.adjustCalloutPosition (https://localhost:7038/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:50:1372355)
> at e.invokeComponentMethod (https://localhost:7038/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:50:1112736)
> at https://localhost:7038/_framework/blazor.webassembly.js:1:2878
> at new Promise (<anonymous>)
> at b.beginInvokeJSFromDotNet (https://localhost:7038/_framework/blazor.webassembly.js:1:2835)
> at Object.vn [as invokeJSJson] (https://localhost:7038/_framework/blazor.webassembly.js:1:58849)
> at https://localhost:7038/_framework/dotnet.runtime.8.0.8.80cvijctdx.js:3:178428
> at Ll (https://localhost:7038/_framework/dotnet.runtime.8.0.8.80cvijctdx.js:3:179262)
It looks like the problem has something to do with a function that wants to set the css "k-callout-e" class to some object.
The problem appears in js when e is null in the following method:
e.classList.add(t)
In this case e = null and t = "k-callout-e". It seems there's no null check for e and VS 2022 reports the problem.
The debugger in VS cannot be disabled for js content as it seems it's the same debugger for Blazor itself.
When hitting F5 to continue multiple times the projects keeps running until it hits the same problem again.
In my project I added a single "TelerikTooltip" component for Tooltips. I tried disabling it but still the same problem.
Maybe the js code is used for some other component.
If you need more information just let me know.
Regards,
Tom
Hi, I just came accross a bug in the TelerikStepper.
I try to create a custom version that switches to a custom success icon after a step is completed.
It contains the following codesnippets:
<TelerikStepper Linear="true" ValueChanged="@HandleValueChanged">
<StepperSteps>
@for (int i = 0; i < IsValidArray.Length; i++)
{
<StepperStep Valid="@IsValidArray[i]"></StepperStep>
}
</StepperSteps>
</TelerikStepper>
@code {
bool?[] IsValidArray = [null, null, null, null];
public void HandleValueChanged(int index)
{
for (int i = 0; i < IsValidArray.Length; i++)
{
IsValidArray[i] = index > i ? true : null;
}
}
}
Forward it works like expected:
When moving backwards it behaves strange:
Except if you are debugging (Visual Studio debugger), then everything works as expected:
Same thing can be achived when not debugging but clicking on the step a second time.
This can not be solved by adding the @key parameter as suggested in https://feedback.telerik.com/blazor/1659827-bug-in-the-telerikstepper-in-blazor from Hristian Stefanov!
Nevertheless, it turns out that the Task.Delay(1); seems to solve the Issue somehow.
Is this intended?