Right now, when calling the ToDataSourceResult extension method on IQueryable object, the DB is queried using the given filters for example from a DataSourceRequest object. However, if I want to apply complex queries based on those filters, this is not possible unless rewriting the existing extension method to return an IQueryable.
Proposal Example API
var dataSourceRequest = new DataSourceRequest();
DataSourceResultWithQuery dataSourceResultWithQuery = query.ToDataSourceResultWithQuery(dataSourceRequest);
public class DataSourceResultWithQuery : DataSourceResult
{
[JsonIgnore]
public IQueryable query { get; set; }
}
Is it possible for this to be added as an extension method? I am currently doing this using a custom class that parses the dataSourceRequest class and returning the IQueryable, but it would be nice if this was an included extension method.
Thank you.
Normally, when we develop we try to give a homogeneous behavior to our applications for the user.
This is a uncomfortable when the default behavior of our application does not match those of the Telerik controls because it becomes verbose and repetitive. I look at my code and constantly repeat configurations for the different controls.
For example, in 99% times I use:
<TelerikGrid EditMode="GridEditMode.Inline" />
or
<GridColumn ShowFilterCellButtons="false" TextAlign="ColumnTextAlign.Center" />
{
"TelerikGrid.EditMode": "GridEditMode.Inline",
"GridColumn.ShowFilterCellButtons": false,
"GridColumn.TextAlign": "ColumnTextAlign.Center"
}
<GridCommandColumn Width="90px">
<div class="text-center">
<GridCommandButton Command="Edit" Icon="@SvgIcon.Pencil" />
<GridCommandButton Command="Delete" Icon="@SvgIcon.Trash" />
<GridCommandButton Command="Save" Icon="@SvgIcon.Save" ShowInEdit="true" />
<GridCommandButton Command="Cancel" Icon="@SvgIcon.Cancel" ShowInEdit="true" />
</div>
</GridCommandColumn>
Changing "Delete" icon in the whole application seems trivial, but think that you could modify the default behavior homogeneously in the whole application or in part of it if the configuration file had a hierarchical behavior, changing one properpty in one place.
I think it would be a very useful functionality to give homogeneity to an application in a very effective way, without breaking changes and making a less verbose and repetitive code.
Thank you for reading me !
Hi,
When we use the TelerikDropDownList with a large amount of data (client side) in Blazor, the dropdown takes several seconds to open the popup. (*)
Even with the most simple version of the TelerikDropDownList component:
<TelerikDropDownList Data=@Logic.LuNacebelCodes
TextField="DisplayName"
ValueField="Id"
@bind-Value=@dto.Party.LuNacebelCodeId
Filterable="true" FilterOperator="@StringFilterOperator.Contains">
<DropDownListSettings>
<DropDownListPopupSettings Height="200px" />
</DropDownListSettings>
</TelerikDropDownList>
But isn't it strange the same dropdownlist in Kendo for jQuery (AngularJS) with exactly the same dataset, doesn't react slow and opens on the fly..?
Is the DOM manipulation in Blazor that much slower then?
(*) We know Virtualization fixes this problem, but it has some limitations.
Thanks in advance.
Hi
I am trying to do very simple InCell editing of various columns string etc. In my model i have various Decimal? types fields. When i update the grid incell the
OnUpdate event fires but the property value is always null. Its like its not biding properly. Seems like you have had similar to this bug in previous versions. Seems like a very simple functionality that the grid should support.
Also it doesn't allow me to enter more than 1 digit after this also as if i type a decimal point it jsut clears it.
I have added a video showing this behaviour.
Please assist. This is the Grid code below.
@if (_stockOrderLinePOCO != null)
In a cascading parent/child scenario (both DropDownLists), the args.Request.Skip property in the child's OnRead handler is not reset after rebinding the child data from the OnChange of the parent. This is a problem when the Skip is larger than the total amount of child items that are available from the back-end for the new parent. The api that is called in the OnRead handler returns nothing when for example the Skip still is 15 and there are only 10 items available.
I tried many things (in many different orders) to clear the child's state properly:
- set the model property which is bound to the child to it's default value
- called StateHasChanged()
- played around with Task.Delay
- set the child's value to it's default value
- set the child's Data property to null
- set the child's Data property to an empty list
- called child.Refresh()
- called child.Rebind()
- even tried to use reflection to reset the private proteced Skip property
Sort of a workaround:
In the OnRead handler after the api call compare the total item count with the skip and refetch with skip = 0 when skip > total item cound. This gives me the data I need but it is still shown at the old Skip position (with a buch of empty lines before that).
This bugreport (https://feedback.telerik.com/blazor/1558042-cascading-virtual-dropdownlist-does-not-reset-scrollbar) seems similar. In a response we are advised to clear the scrollbar position maually (which sounds a bit like the Skip position).
Please advise on how to reset the state manually because I don't see how. And if this is not possible, please add some functionality to do so. Perhaps something like the DataGrid's GetState, SetState methods?
Regards,
Harmen
Can you update the templates that come with Telerik Blazor?
For example, you are using an EditForm control instead of the telerik Blazor Form control.
There is an expression, eat your own dog food. I often spin up template projects to play with new features or tweak existing ones. Be nice take full advantage of current state of blazor components and provide samples that people can use as a learning tool or launching point.
Peter
Hello,
is there a way to use the kendo-popup from https://www.telerik.com/kendo-angular-ui/components/popup/ in Telerik UI for Blazor? Is it a planned feature for the future?
Thank you,
Christian
https://blazorrepl.telerik.com/cdkTuxEg30UJXWug36
When trying to expand the drop downs, some of them do not expand.
It is impossible to give a scenario that always behaves the same, but if
you keep expending the drop downs sooner or later some will stop working.
Hi Team,
We tried to use the TelerikLoader in Blazor WASM app, but the loader is not appearing on the page. We tried the basic example given in the Demo but did not work.
We are using latest Telerik Version (2.20.0).
@if (IsLoading)
{
<TelerikLoader />
}
else
{
@Data
}
We have below references in index.html
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>THOR.UI</title>
<base href="/" />
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/app.css" rel="stylesheet" />
<link href="css/toggle.css" rel="stylesheet" />
<link href="css/spinner.css" rel="stylesheet" />
<script src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js"></script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link id="theme" rel="stylesheet" href="./css/thor-light-theme-material.css" />
<link href="_content/Blazored.Toast/blazored-toast.min.css" rel="stylesheet" />
<script src="./site.js"></script>
<script src="_content/BlazorInputFile/inputfile.js"></script>
<script src="_content/BlazorPro.BlazorSize/blazorSize.min.js"></script>
<script src="_content/Fluxor.Blazor.Web/scripts/index.js"></script>
<script src="./scripts/download.js"></script>
</head>
I tried to follow this below article and add the reference as below and CDN also but it did not work.
<!DOCTYPE html>
<html>
<head>
. . .
<link href="/css/kendo-themes/default/dist/all.css" rel="stylesheet"/>
<!-- Choose only one of the themes -->
<!-- <link href="/css/kendo-themes/bootstrap/dist/all.css" rel="stylesheet" />
<link href="/css/kendo-themes/material/dist/all.css" rel="stylesheet" /> -->
</head>
Please let us know what changes we have to make this to work.
Thanks
Chandra Vanama
Hi we are using blazor for mobile apps.
For image upload via Camera, we need features where by compressed images can be upload.
Also zoom in and zoom out features when we are showing at front end app
Setting the FilterDirector directly:
Setting FilterDescriptor via SearchText:
Our search box is a custom TelerikTextbox not part of the grid, but essentially the same functionality as the built-in search box.
To test, use this code:
https://docs.telerik.com/blazor-ui/components/grid/filter/searchbox#customize-the-searchbox
But add it to FilterDescriptor immediately rather than setting SearchFilter like on the link.
This is the only instance of this on our site, and all of our grids use the exact same code via a generic method, on our object that controls the grid we have a custom empty attribute to dictate whether a column should be filterable via our textbox.
I would like to pass a defined piece of data in when I add a new row in a hierarchical Blazor grid. in the example below, I have a hierarchy of Agency > District > School. When I add a new school within a district, I would like to pass the District ID so that the user does not have to select it or type it in.
I have a district ID column in the schools grid, but (a) it would be better if the user did not see this and (b) when I click "Add school" that field is always passed as empty. Is there any way to pass the
districtSchools.Dist.DISTRICT_ID
variable when I add a row?
<TelerikGrid Data="@Agencies" Sortable="true" Reorderable="true" OnUpdate="@UpdateHandlerAgency">
<DetailTemplate Context="granteeAgency">
@{
var leadAgency = granteeAgency as Agency;
<TelerikGrid Data="leadAgency.Districts" OnUpdate="@UpdateHandlerDistrict" OnRowRender="@OnRowRenderHandlerDistrict">
<GridColumns>
<GridColumn Field="@(nameof(District.Dist.DistrictName))" Editable="false">
<Template>
@((context as District).Dist.DistrictName.ToString())
</Template>
</GridColumn>
<GridColumn Field="@(nameof(District.DistAlloc))">
<Template>
@((context as District).DistAlloc.ToString("C"))
</Template>
</GridColumn>
<GridCommandColumn>
<GridCommandButton Command="Edit" Icon="edit">Edit</GridCommandButton>
<GridCommandButton Command="Save" Icon="save" ShowInEdit="true">Update</GridCommandButton>
<GridCommandButton Command="Cancel" Icon="cancel" ShowInEdit="true">Cancel</GridCommandButton>
</GridCommandColumn>
</GridColumns>
<DetailTemplate Context="districtSchools">
<TelerikGrid Data="districtSchools.Schools" OnCreate="@CreateHandlerSchool" OnDelete="@DeleteHandlerSchool" OnUpdate="@UpdateHandlerSchool" OnRowRender="@OnRowRenderHandlerSchool">
<GridToolBar>
<GridCommandButton Command="Add" Icon="add">Add School</GridCommandButton>
</GridToolBar>
<GridColumns>
<GridColumn Field="@(nameof(School.SchoolName))">
<Template>
@((context as School).SchoolName.ToString())
</Template>
</GridColumn>
<GridColumn Field="@(nameof(School.SchoolAlloc))">
<Template>
@((context as School).SchoolAlloc.ToString("C"))
</Template>
</GridColumn>
<GridColumn Field="" Visible="true">
<Template>
@districtSchools.Dist.DISTRICT_ID
</Template>
<EditorTemplate>
@districtSchools.Dist.DISTRICT_ID
</EditorTemplate>
</GridColumn>
<GridCommandColumn>
<GridCommandButton Command="Edit" Icon="edit">Edit</GridCommandButton>
<GridCommandButton Command="Save" Icon="save" ShowInEdit="true">Update</GridCommandButton>
<GridCommandButton Command="Delete" Icon="delete">Delete</GridCommandButton>
<GridCommandButton Command="Cancel" Icon="cancel" ShowInEdit="true">Cancel</GridCommandButton>
</GridCommandColumn>
</GridColumns>
</TelerikGrid>
</DetailTemplate>
</TelerikGrid>
}
</DetailTemplate>
<GridColumns>
<GridColumn Field="@(nameof(Agency.AgencyName))" Editable="false">
<Template>
@((context as Agency).AgencyName.ToString())
</Template>
</GridColumn>
<GridColumn Field="@(nameof(Agency.AgencyAlloc))">
<Template>
@((context as Agency).AgencyAlloc.ToString("C"))
</Template>
</GridColumn>
<GridCommandColumn>
<GridCommandButton Command="Edit" Icon="edit">Edit</GridCommandButton>
<GridCommandButton Command="Save" Icon="save" ShowInEdit="true">Update</GridCommandButton>
<GridCommandButton Command="Cancel" Icon="cancel" ShowInEdit="true">Cancel</GridCommandButton>
</GridCommandColumn>
</GridColumns>
</TelerikGrid>
Hi Telerik team,
in our Blazor App we have implemented the skip handling logic according to your documentation, but we have noticed an issue. When the sum of the skip and the page size is bigger then the total count of the items and we try to set the Skip property for the second time, some of the top items are not shown.
To demonstrate this, we have created a simple app: https://github.com/0rce/blazor-app-telerik-grid-skip-bug.git
Please clone the repo, start the application and follow the steps displayed above the grid to reproduce the bug.
Do you think it is a bug or is our implementation wrong?
Best regards,
Orce
---
ADMIN EDIT
I have linked this case in the Limitations section of the documentation and you can find more details and a path forward in this KB article: https://docs.telerik.com/blazor-ui/knowledge-base/grid-large-skip-breaks-virtualization.
Considering this and why the grid cannot and should not change this value for you, I am marking this with the "Won't Fix" status - I acknowledge it is behavior that is less than ideal, yet it stems from application logic and the grid cannot fix that.
If someone is looking at the provided repository - please also be aware that it showcases an invalid approach for fetching grid data that I strongly advise against. Review the rest of the thread for more details.
---
Telerik UI Blazor: 2.20.0
OS Windows 10
Google Chrome 90.0.4408.5
Framework Bootstrap v. 4.6.0
Kendo-theme-bootstrap 4.24.0
Registration bootstrap tooltip:
$(function () { $('[title]').tooltip() })
How to repeat? Click on a component, point to any day, wait from 1 to 1.5 seconds and select an item (click), do not move the cursor for 1 second.
We have had major complaints from users when using the combo box. They use the filter, see the first item highlighted, then click tab and the item in not selected. They do a lot of data entry and don't want to use the mouse or use the down arrow to select it. They are used to a regular HTML select control which works that way. Is there any Javascript workaround for this? If not, I probably have to go back to using a standard select box. The reason I am using the combobox and not the dropdown is because your dropdown doesn't support tabbing out of the box and that was a deal breaker for them.
I saw an article on using the PopupClass for the ComboBox but that isn't a supported property.
Thanks!
Hi,
I tried today to upgrade version of Telerik.UI.for.Blazor. My previous, working version was 2.20.0. All my projects are using .NET 5.0 framework and it's running on linux.
It seems like kind of regression issue, all I did was to push packages to our private feed (I checked them all few times) and update Telerik.UI.for.Blazor from 2.20 to 2.22. It should just work.
➜ App git:(charts) ✗ dotnet add package Telerik.Documents.SpreadsheetStreaming -v 2021.1.222 Determining projects to restore... Writing /tmp/tmpgV3v8N.tmp info : Adding PackageReference for package 'Telerik.Documents.SpreadsheetStreaming' into project '/PathToProject/App/ProjectName.App.csproj'. info : Restoring packages for /PathToProject/App/ProjectName.App.csproj... info : GET https://api.nuget.org/v3-flatcontainer/telerik.documents.spreadsheetstreaming/index.json info : CACHE https://nuget.pkg.jetbrains.space/pozitive/p/hcs/nuget-with-telerik/v3/flatcontainer/telerik.documents.spreadsheetstreaming/index.json info : NotFound https://api.nuget.org/v3-flatcontainer/telerik.documents.spreadsheetstreaming/index.json 411ms error: NU1102: Unable to find package Telerik.Documents.SpreadsheetStreaming with version (>= 2021.1.222) error: - Found 1 version(s) in space-nuget-with-telerik [ Nearest version: 2020.3.1019 ] error: - Found 0 version(s) in nuget.org error: Package 'Telerik.Documents.SpreadsheetStreaming' is incompatible with 'all' frameworks in project '/PathToProject/App/ProjectName.App.csproj'.
For reference, here are csproj of my two projects (app and test)
App.csproj:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AngleSharp" Version="1.0.0-alpha-844" />
<PackageReference Include="Blazored.Toast" Version="3.1.2" />
<PackageReference Include="Marten" Version="4.0.0-alpha.5" />
<PackageReference Include="Marten.NodaTime" Version="2.0.0-alpha.5" />
<PackageReference Include="Microsoft.AspNetCore.Components.DataAnnotations.Validation" Version="3.2.0-rc1.20223.4" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.1" />
<PackageReference Include="Telerik.UI.for.Blazor" Version="2.20.0" />
</ItemGroup>
<!-- Identity stuff-->
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="5.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="5.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="5.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\css\bootstrap" />
</ItemGroup>
</Project>
Tests:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="NSubstitute" Version="4.2.2" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.14" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="1.3.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\App\AppName.App.csproj" />
</ItemGroup>
</Project>
Best Regards,
Rafał Kopczyński
Hi,
I have seen Form - Auto-Generated sample in Blazor which is nice and handy, but what should I do, if I need to define a Dynamic event by code for a dropdown change for example ?
I might need to define and handle an event for each control that is dynamically generated. I hope someone can help.
Regards