Telerik Forums
UI for Blazor Forum
0 answers
353 views

hi,

I've been working on creating a form using the Telerik Wizard component, allowing users to fill out information across different steps. I've been using the same model for binding data in several WizardSteps. I referred to the example here: https://demos.telerik.com/blazor-ui/wizard/overview . However, I've removed the confirmation page since it's not necessary for my use case.
In the model, I have a few required fields, but I don't want to prevent users from moving to the next page if the current page's input is invalid. Instead, I'd like to collect all the validation messages and display them in their entirety on the last step. To achieve this, I placed a <TelerikValidationSummary> component in the last step of the wizard.
However, it seems that the validation messages aren't being displayed. I've attached a screenshot of my Razor page for your reference. It's a blazor webassembly app.
If anyone could provide insights or guidance on how to make the validation summary work properly, I'd greatly appreciate it!

Thanks in advance for your help!

Nidhi
Top achievements
Rank 1
 asked on 23 Aug 2023
11 answers
8.0K+ views

I'm wondering how I can two-way bind a TelerikDropDown selection to a complex model object rather than a primitive type such as an Id field. I'm trying to add a TelerikDropDownList to a page where the user can select a user-friendly name of an object and have that selection's value bound to the object itself rather than a primitive data type. For example:

<TelerikDropDownList Data="@DropDownItems" TextField="LabelField" ValueField="ValueField" @bind-Value="@SelectedItem"/>
 
@code {
    public List<GenericDropDownModel<Item>> DropDownItems { get; set; }
    public IEnumerable<Item> AllItems { get; set; }
    public Item SelectedItem { get; set; }
     
    protected override Task OnInitializedAsync()
    {
        AllItems = await DataService.LoadItems();
        SelectedItem = AllItems.First();
    }
     
    private void SetDropDownItems()
    {
        List<GenericDropDownModel<Item>> dropDownItems = new List<GenericDropDownModel<Item>>();
        if (AllItems != null)
        {              
            foreach(var item in AllItems)
            {
                GenericDropDownModel<Item> dropDownItem = new GenericDropDownModel<Item>()
                {
                    ValueField = item,
                    LabelField = item.Name
                };
                dropDownItems.Add(dropDownItem);
            }
        }
        DropDownItemsItems = dropDownItems;
    }
 
    public class GenericDropDownModel<T>
    {
        public string LabelField { get; set; }
        public T ValueField { get; set; }      
    }
 
    public class Item
    {
        public string Name { get; set; }
        public IModel Model { get; set; }
        public IEnumerable<IOtherModel> OtherModels { get; set; }      
    }
     
    public class Model
    {
        public int Id { get; set; }
        public string Name { get; set; }

        public string Info { get; set; }

        public IAnotherModel MoreDetails { get; set; }
    }
}

 

The drop-down is not allowing me to bind to non-primitive types nor specify a property of a property, i.e.:

<TelerikDropDownList Data="@AllItems" TextField="Name" ValueField="@Model.Info" @bind-Value="@SelectedInfo"/>


I get the following error with the first code snippet scenario:

System.InvalidOperationException: Telerik.Blazor.Components.TelerikDropDownList`2[GenericDropDownModel`1[Item],Item] does not support the type 'Item'.
   at Telerik.Blazor.Components.Common.TelerikSelectBase`2.TryParseValueFromString(String value, TValue& result, String& validationErrorMessage)
   at Telerik.Blazor.Components.Common.TelerikSelectBase`2.set_CurrentValueAsString(String value)
   at Telerik.Blazor.Components.TelerikDropDownList`2.SelectItem(ListDataItem item)
   at Telerik.Blazor.Components.TelerikDropDownList`2.OnParametersSetAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
Víctor
Top achievements
Rank 1
Iron
Iron
Iron
 updated answer on 23 Aug 2023
1 answer
121 views

If I minimize a TelerikWindow, the tooltip that appears on the "Restore window" button shows "Minimize" instead of (say) "Restore".

Please see attached file.

Version is 4.4.0.

Thank you.

Georgi
Telerik team
 answered on 23 Aug 2023
1 answer
172 views

Hi there.
I'm using the MultiSelect component and limiting how many items the user can select from the drop-down list.
I've used the following guide to achieve that goal (specifically the first code snippet in the "Solution" section): https://docs.telerik.com/blazor-ui/knowledge-base/multiselect-always-select-item-limit-total#solution
Adding the AutoClose="false" instruction in the TelerikMultiSelect element and selecting more than one item will create a mismatch between what is seen in the drop-down list VS what is seen in the input box.
Losing focus of the component and then regaining focus of it will show the correct items that have been selected, but deselecting the items in this state will also create the mismatch mentioned.
The following gif showcases both situations: https://i.gyazo.com/9ad670d9b3cffc3d0b43cb457bb57a6d.mp4

Here is the REPL link: https://blazorrepl.telerik.com/cdkCbXcm22boLMeV33

The issue does not happen because of the "static item" used in the example; here is a REPL link which has the code about the "static item" removed: https://blazorrepl.telerik.com/mHEsFjwQ26ywR1tD29

Georgi
Telerik team
 answered on 23 Aug 2023
0 answers
121 views

Hello, we have a strange behavior in the scheduler.

When first called up, the appointments in the timeline are displayed correctly in the order of their resource. (The text in the appointment corresponds to the id of the resource.)

If you switch the scheduler view to day and then back to timeline, everything is still displayed correctly.

However, if you switch to the weekly or monthly view and then back to the timeline, some of the appointments shift down by about 250px and end up in the wrong resource or no resource at all.

Helmut
Top achievements
Rank 1
Iron
 asked on 22 Aug 2023
1 answer
471 views

I am using the TelerikPanelBar with only 1 item to create a collapsible form.
Is it possible to control the color and background color of the HeaderTemplate.

  <TelerikPanelBar Data="@Model"
    ExpandedItems="@Model">

    <PanelBarBindings>

      <PanelBarBinding>

        <HeaderTemplate>
          <h4>Filters</h4>
        </HeaderTemplate>

      </PanelBarBinding>

    </PanelBarBindings>

  </TelerikPanelBar>

Hristian Stefanov
Telerik team
 answered on 22 Aug 2023
0 answers
271 views

I have a simple TelerikGrid within a blazored modal:


<TelerikGrid Data="this.Model"                 
             Height="400px">
    <GridColumns>
        <GridColumn Field="Id" Width="30px" Title="Id" />
        <GridColumn Field="Name" Title="Name" />
        <GridColumn Field="RoleId" Width="30px" Title="SRRid" />
    </GridColumns>
</TelerikGrid>

when I load the information I get 50 records, due to the modal size I can only see 15 records, however the vertical scrollbar is not being displayed.

Am I missing something else that I need to configure?

 

 

Alberto
Top achievements
Rank 1
 asked on 22 Aug 2023
1 answer
252 views

Good morning. In my code I've seen that AutoFitAllColumnsAsync works only from the second time on. I'm asking you if I'm missing something or doing something wrong.

Follows 2 repl link:

in the first one when you click on the upper button to load data, the data are loaded and then AutoFitAllColumnsAsync is called twice and works: https://blazorrepl.telerik.com/GxkiFivl46gBfE8o57

in the second one when you click on the upper button to load data, the data are loaded and then AutoFitAllColumnsAsync is called only once and doesn't work: https://blazorrepl.telerik.com/wdEsbsPF50K99GvR04

Please note that in the second example if you click again on the load data button the AutoFitAllColumnsAsync is correctly applied (in other words, in my examples AutoFitAllColumnsAsync works only from the second time on).

Please let me know if I have to change something in code. Thank you.

 

 

Dimo
Telerik team
 answered on 21 Aug 2023
1 answer
189 views

I have a Blazor server application that is displaying a Gantt control. For several of my users with smaller screen sizes they have noticed that the Tree and Timeline can get out of sync vertically. When scrolling the Tree stops and the Timeline keeps going:

I have also observed that resizing the browser window can result in differences in height of the Tree and Timeline:

Svetoslav Dimitrov
Telerik team
 answered on 18 Aug 2023
1 answer
261 views

Hello,

I'm trying to use the FileSelect control in my Blazor server-side app to allow users to upload one or more files to an S3 bucket. I don't want to upload them individually upon select, the requirement is they can select multiple files several times.  As such I have a separate "Upload" button that calls an event which will kick off the upload.

My goal is to send the file streams to a javascript function so that I can upload them through the user's browser to S3 (using generated pre-signed URLs that DO get created on select). The problem I'm running into is that the Streams are already disposed of after the Select event is done.

I was originally trying to do this with the TelerikUpload control, but that seems geared to sending to an API, and I'm trying to avoid proxying the files internally so I don't have to have the user send files to an internal API and then the API sending them on to S3. 

Are there any examples of what I'm trying to accomplish? Does it even seem possible?

Thanks!
Bill

Dimo
Telerik team
 answered on 18 Aug 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?