Telerik Forums
UI for Blazor Forum
4 answers
430 views

Hi,

I use a TelerikGrid relying on FluentValidator.

Validation works fine when users manually edit a grid value.

But I do not manage to trigger it after the grid loads (so users can view possible incorrect values after DB loading).

 

I have tried 2 different ways, both without success.

1) using validation at Grid level.

Well I basically replicated your demo:

https://docs.telerik.com/blazor-ui/components/grid/editing/validation

 

2) using a TelerikForm inside the (only cell) that needs to be validated.

Something like this:


<TelerikGrid @ref="@_gridRef"
                 TItem="MyDto"
                 Data="@MyItems">

   <GridSettings>
     <GridValidationSettings>
       <ValidatorTemplate>
         <FluentValidationValidator Validator=@_validator />
       </ValidatorTemplate>
     </GridValidationSettings>
   </GridSettings>



 <GridColumns>

[...]

  <GridColumn Field="@nameof(MyDto.MyProp)" Title="My Prop"Context="ctx">
    <Template>
      <EditForm Model="@ctx">
        <FluentValidationValidator Validator=@_validator/>
        <TelerikTextBox @bind-Value="@((ctx as MyDto).MyProp)"/>
      </EditForm>
    </Template>
  </GridColumn>
</GridColumns>
</TelerikGrid>


In both cases, the Textbox turns red if the users types an incorrect value.

But it does not if the grid load an incorrect value from the DB and display it.

 

Any suggestion to make this work?

Arnaud
Top achievements
Rank 1
Iron
 answered on 18 Dec 2023
1 answer
199 views
Is there any way to dynamically hide the Repeat options on the Add Event dialog? We have a scenario where some users should be able to create recurring appointments, but other users should be restricted to creating "one-off" appointments only.

Georgi
Telerik team
 answered on 18 Dec 2023
1 answer
359 views

Hello!

I am using Telerik.UI.for.Blazor version 5.0.0.,

I have a page with a treelist. I want all items to be collapsed when the page is loaded and the treelist is displayed for the first time.

How do I do this?


Georgi
Telerik team
 answered on 18 Dec 2023
0 answers
533 views

Hi,

I'm currently evaluating Telerik UI for Blazor using the new .NET 8 capabilities. 

I'm trying to have static pages (using the default SSR mode) with interactive islands of individual components on the page using RenderMode.InteractiveAuto

Looking at the setup documentation here https://docs.telerik.com/blazor-ui/getting-started/web-app#43-add-the-telerikrootcomponent it says that it's possible to set it only for specific pages and components, but then it says that <TelerikRootComponent> needs to wrap the entire view port (i.e. the whole <div class="page">)

Is there a way to create interactive islands at a component level with Telerik UI for Blazor?

 

Thanks

thing
Top achievements
Rank 1
 asked on 15 Dec 2023
1 answer
248 views

Hi, I want to be able to open the dropdown of the AutoComplete component upon focus of the input field.
I found this can be done with a workaround using Js interop:
https://docs.telerik.com/blazor-ui/knowledge-base/inputs-open-programmatically

However, I feel this functionality should be supported out of the box through some 'OpenOnFocus' parameter on the component.
It would be a very welcome improvement!

Kind regards,

Lennert

Georgi
Telerik team
 answered on 15 Dec 2023
2 answers
378 views

I have just for the first time tried server side paging and filtering using the ToDataSourceResultAsync extension.

This works REALLY well.

The only problem I have, is that I can't filter and sort on computed values in my view model as I can when all data manipulation is on the wasm client.

Can I somehow mix server and client sorting? I would like to filter the current page on a field's not in the database. So not another roundtrip only the data on the client.

UPDATE

I am adding filters on the client. It works but the resulting sql uses AND, should be OR

On the client:

private async Task OnReadHandler(GridReadEventArgs arg)
    {
        Query.GridRequest = arg.Request;
        var request = Query.GridRequest;
        var searchBoxFilter = request.Filters.SelectMemberDescriptors().Where(x => x.Member == "ProductName").ToList();
        if(searchBoxFilter.Any())
        {
            var clientFilter = new FilterDescriptor{Member = "ClientName", Operator = FilterOperator.Contains, Value = searchBoxFilter.First().Value.ToString()};
            request.Filters.Add(clientFilter);
            var initialsFilter = new FilterDescriptor{Member = "UserInitials", Operator = FilterOperator.Contains, Value = searchBoxFilter.First().Value.ToString()};
            request.Filters.Add(initialsFilter);
        }
        
        var envelope = await TradeOverviewService.GetCertificateTradeRequestsForTradeOverView(Query);
        arg.Data = envelope.CurrentPageData.ToList();
        arg.Total = envelope.TotalItemCount;
    }

Part of the sql


  FROM "IBEX"."V_CERTIFICATE_TRADE_REQUEST" "v"
    WHERE (("v"."FLOW_TYPE" NOT IN (8, 10)) AND ((((LOWER("v"."PRODUCT_NAME_INTERNAL") LIKE '%sydbank%') AND (LOWER("v"."CLIENT_NAME") LIKE '%sydbank%')) AND (LOWER("v"."USER_INITIALS") LIKE '%sydbank%'))))
    ORDER BY "v"."TRADE_DATE" DESC
    OFFSET :p_0 ROWS FETCH NEXT :p_1 ROWS ONLY

So can I create the filters so the resulting sql will be.


  FROM "IBEX"."V_CERTIFICATE_TRADE_REQUEST" "v"
    WHERE (("v"."FLOW_TYPE" NOT IN (8, 10)) AND ((((LOWER("v"."PRODUCT_NAME_INTERNAL") LIKE '%sydbank%') OR (LOWER("v"."CLIENT_NAME") LIKE '%sydbank%')) OR (LOWER("v"."USER_INITIALS") LIKE '%sydbank%'))))
    ORDER BY "v"."TRADE_DATE" DESC
    OFFSET :p_0 ROWS FETCH NEXT :p_1 ROWS ONLY

Martin Herløv
Top achievements
Rank 2
Bronze
Iron
Iron
 answered on 15 Dec 2023
1 answer
1.4K+ views

Hi all,

I've been trying to get new Blazor projects off the ground with Telerik 4.4, and had some luck with WASM but unfortunately Blazor Server I cannot get to work.

I have kept my projects simple, following the guidance set out in the Getting Started articles but every time run into the same error in the web client.

Error: Microsoft.JSInterop.JSException: Maximum call stack size exceeded
RangeError: Maximum call stack size exceeded
    at e.deepExtend (https://localhost:7144/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:50:1075205)
    at e.deepExtend (https://localhost:7144/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:50:1075502)
    at e.deepExtend (https://localhost:7144/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:50:1075440)
    at e.deepExtend (https://localhost:7144/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js:50:1075440)
.... (repeats)

   at Microsoft.JSInterop.JSRuntime.InvokeAsync[TValue](Int64 targetInstanceId, String identifier, Object[] args)
   at Telerik.Blazor.Components.TelerikMediaQuery.InitMediaQueryWidget()
   at Telerik.Blazor.Components.TelerikMediaQuery.OnAfterRenderAsync(Boolean firstRender)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

This stops any Telerik components from working, and leaves me a bit stuck!

Anyone seen similar? Or know of a workaround?

Dimo
Telerik team
 answered on 14 Dec 2023
2 answers
159 views

Only available template is "Blank" all other templates are disabled. When I change TARGET FRAMEWORK to .NET7 all other templates are available.

When will this feature will be available for .NET8?

Regards,

Djole

Djordje
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 14 Dec 2023
1 answer
104 views

We have observed that the greater the number of time slots displayed, the greater the displacement of the start of the appointment with respect to the start time. What can i do?

An example in https://blazorrepl.telerik.com/cxPQvRvP36cnvfYz59

Thanks in advance,

Nelson

Hristian Stefanov
Telerik team
 answered on 14 Dec 2023
1 answer
426 views

How do I set the background on the dropdown? 

 

 


<div class="container">
    <div class="row justify-content-md-end text-light gsi-background-color-darkgray">

        <div class="col">
        </div>
        <div class="col-md-auto">
            <TelerikMenu Data="MenuItems" 
                OnClick="@((TelerikMenuItem item) => OnMenuClicked(item))">
            </TelerikMenu>
        </div>
    </div>
</div>


    public class TelerikMenuItem
    {
        public string Text { get; set; }
        public bool Disabled { get; set; }
        public bool Separator { get; set; }
        public string Url { get; set; }
        public IEnumerable<TelerikMenuItem> Items { get; set; }
    }

Hristian Stefanov
Telerik team
 answered on 13 Dec 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?