Telerik Forums
UI for Blazor Forum
1 answer
40 views

My requirements:

  • Ability for user to add shapes (rectangle, square, circle) or image to a map.
  • Ability for the user to move that shape around on a map (drag and drop).
  • Ability for the user to save all the placed shape geolocations.
  • Ability to read the saved shape geolocations and place them on the map.

I did a little research on your Map control and it does seem to support layers and a specific layer  type called "shape".  However, when I look at the code sample I don't see any way to define the shape (circle, rectangle, etc.) nor provide dimensions for the shape (L X W) nor have a bitmap/image as a shape?

I also didn't see any drag and drop support?

Could I get answers to these questions and/or point me to documentation that supports my requirements?

Cheers, Rob.

Dimo
Telerik team
 answered on 13 Mar 2024
1 answer
23 views

Date Picker UI component is unresponsive. The calendar drop down does not work and masking is not being applied. I followed the instructions on First Steps with UI for Blazor in a Web App - Telerik UI for Blazor I have the nuget package set up, I have the scripts in, I followed the instructions and double checked that I followed all of them. I can't figure out why this ui component is not working.

 

@page "/datePicker"
@attribute [StreamRendering]

<PageTitle>Telerik DatePicker</PageTitle>


The selected date is: @datePickerValue.ToShortDateString()
<br />

<TelerikDatePicker @bind-Value="datePickerValue"
                   Format="dd MMMM yyyy"
                   Min="@Min" Max="@Max">
</TelerikDatePicker>

@code {
    DateTime datePickerValue { get; set; } = DateTime.Now;
    public DateTime Min = new DateTime(1990, 1, 1, 8, 15, 0);
    public DateTime Max = new DateTime(2025, 1, 1, 19, 30, 45);
}

 

Dimo
Telerik team
 answered on 13 Mar 2024
1 answer
19 views
How can I change the indentation of the child items in hierarchical grids. I want the children to start at the same beginning as the parent element
Dimo
Telerik team
 answered on 12 Mar 2024
1 answer
38 views

Hi,

I'm attempting to do something that is probably dumb/unsupported. We have a paginated grid in our UI that we want to include a joined model in.

Example:


public class Item
{
   [Key]
   public Guid ItemId{ get; set; } = Guid.NewGuid();
   public Guid? LatestLogId { get; set; }
}

public class ItemLog
{
   [Key] 
   public Guid ItemLogId{ get; set; }
   
   public Guid ItemId{ get; set; }
   [ForeignKey("ItemId")]
   public Item? Item { get; set; }

   [MaxLength(250)] public string Message { get; set; } = null!;
}


We use 'LatestLogId' in order to know what ItemLog to 'include' in the results in the UI

I'm trying to project it into a Dto that includes both the Item and the LatestLog but running into some trouble calling 'ToDataSourceResultAsync' with that IQueryable<Dto>


 public async Task<DataSourceResult> GetItemReportPage(DataSourceRequest pageRequest, Guid staffId,
        bool includeAll = false)
    {
            var baseQuery = _appContext.Items
                .AsQueryable();
            if (!includeAll)
            {
                baseQuery = baseQuery.Where(x => x.CreatedBy== staffId);
            }
                var query= baseQuery.Select(item => new ItemWithLatestLogDto
                    {
                        LatestLog = _appContext.ItemLogs.FirstOrDefault(x => x.ItemLogId== request.LatestLogId) 
                    })
                    .AsNoTracking();


        var dataSourceResult = await query.ToDataSourceResultAsync(pageRequest);
        return dataSourceResult;
    }


When calling that I get an error that is something like this:


System.InvalidOperationException: The LINQ expression 'DbSet<Item>()
    .Where(n => n.CreatedById== __staffId_0)
    .OrderByDescending(n => new ItemWithLatestLogDto{ LatestLog = DbSet<ItemLog>()
            .Where(r => (Guid?)r.ItemLogId== n.LatestLogId)
            .FirstOrDefault() }
    .CreatedDateTimeUtc)' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.
   at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.<VisitMethodCall>g__CheckTranslated|15_0(ShapedQueryExpression translated, <>c__DisplayClass15_0&)
   at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.QueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.RelationalQueryableMethodTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)
   at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
   at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.CompileQueryCore[TResult](IDatabase database, Expression query, IModel model, Boolean async)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass9_0`1.<Execute>b__0()
   at Microsoft.EntityFrameworkCore.Query.Internal.CompiledQueryCache.GetOrAddQuery[TResult](Object cacheKey, Func`1 compiler)
   at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.Execute[TResult](Expression query)
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryProvider.Execute[TResult](Expression expression)
   at Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1.System.Collections.IEnumerable.GetEnumerator()
   at Telerik.DataSource.Extensions.QueryableExtensions.Execute[TModel,TResult](IQueryable source, Func`2 selector)
   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)

The Dto looks like this:

public class ItemWithLatestLogDto: Item
{
    public ItemLog? LatestLog { get; set; } 
 
    public NewFileRequestWithLatestLogDto()
    {
    }
}



Is this a use-case supported by the method or do I need to find a different way of accomplishing this?

Thanks!



Svetoslav Dimitrov
Telerik team
 answered on 11 Mar 2024
1 answer
21 views
I need to know when the grid has been rendered. Is there a way?
Hristian Stefanov
Telerik team
 answered on 11 Mar 2024
2 answers
31 views

Hy,

In my application I had to insert the localization with the default Italian language.

I followed the points explained in this link step by step: Blazor Localization - Telerik UI for Blazor

Inside my application I therefore have a Resources folder with the following files inside:
TelerikMessages.resx and TelerikMessages.it-IT.resx (set as default on Program.cs).

My problem is the following: in debug the localization for the DateTimePicker or NumericTextBox components works correctly showing me the date and number formats in Italian with the related translated texts.

However, once I insert my application into a docker container, the localization seems to have no effect, showing both components in English language and format.

My Resources Folder:

However, localization for the Grid component works correctly in both cases.

Attached is the behavior of the date picker in debug mode and inside a docker container.

Can anyone give me a solution without using the Format property of the components but using localization? My application is in Dotnet 8

Thanks.

Marco
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 11 Mar 2024
1 answer
35 views

When I use the ColumnSpan property on a floating label, the label itself will grow to the number of columns, but the content of the label will always get the size of the column the floating label is int.

Below is the code I've used:


@page "/gridLayout"

<TelerikGridLayout>
    <GridLayoutColumns>
        <GridLayoutColumn Width="200"/>
        <GridLayoutColumn Width="200"/>
        <GridLayoutColumn Width="200"/>
        <GridLayoutColumn Width="200"/>
    </GridLayoutColumns>

    <GridLayoutItems>
        <GridLayoutItem Column="1"
                        Row="1"
                        ColumnSpan="3">
            <TelerikTextBox Title="Filial" />
        </GridLayoutItem>
        <GridLayoutItem Column="1"
                        Row="2"
                        ColumnSpan="3">
            <TelerikFloatingLabel Text="Pessoa">
                <TelerikTextBox />
            </TelerikFloatingLabel>
        </GridLayoutItem>
    </GridLayoutItems>
</TelerikGridLayout>

This is how it's rendered:

 

Diego Modolo
Top achievements
Rank 1
Iron
Iron
 answered on 08 Mar 2024
1 answer
18 views

Hello Guys, i got the License for Blazor Application, 

I'm using Server Side at .net 6 and i put the css and js on _Layout :

<link rel="stylesheet" href="_content/Telerik.UI.for.Blazor/css/kendo-theme-default/all.css" />

<script src="_content/Telerik.UI.for.Blazor/js/telerik-blazor.js" defer></script>

On nuget i got the full version as well,

But i keep receiveng the trial version message when i use PDF Viewer, am i missing anything else? 

 

Dimo
Telerik team
 answered on 08 Mar 2024
1 answer
15 views
Looking for a solution to expand the previous expanded DetailTemplate after a grid rebind.  The data for the grid is updated from a click event within the DetailTemplate and need the grid updated and the expanded row to either stay expanded or re-expand after the grid rebind.
Tsvetomir
Telerik team
 answered on 07 Mar 2024
1 answer
18 views

Hi everyone

When using a translated ListView, the page size selector behaves weird.

When the dropdown is opened, the correct text ("Alle") gets displayed. But when the dropdown is closed, the english text is shown,

Any ideas?

Thanks alot and have a nice day

Dimo
Telerik team
 answered on 07 Mar 2024
Top users last month
Dominik
Top achievements
Rank 1
Giuliano
Top achievements
Rank 1
Dominic
Top achievements
Rank 1
Glendys
Top achievements
Rank 1
Iron
NoobMaster
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?