Completed
Last Updated: 18 Apr 2024 11:41 by ADMIN
Release 2024 Q2 (May)
Created by: Mike
Comments: 1
Category: Form
Type: Bug Report
0

When I assign an Id to a FormGroup in TelerikForm, it's value can be seen in code, but neither the attribute nor it's value get rendered.

 

<TelerikForm Model="@TestUser"
                     OnValidSubmit="@HandleValidSubmit"
                     OnInvalidSubmit="@HandleInvalidSubmit">
            <FormValidation>
                <DataAnnotationsValidator></DataAnnotationsValidator>
            </FormValidation>
            <FormItems>
                <FormGroup LabelText="User Information" Id="userinfo">
                    <FormItem Field="@nameof(User.FirstName)"></FormItem>
                    <FormItem Field="@nameof(User.LastName)"></FormItem>
                    <FormItem Field="@nameof(User.Email)">
                        <Template>
                            <label for="mail" class="k-label k-form-label">Email*:</label>
                            <TelerikTextBox Id="mail" @bind-Value="@TestUser.Email" InputMode="email" Placeholder="example@domain.com"></TelerikTextBox>
                            <TelerikValidationMessage For="@(() => TestUser.Email)"></TelerikValidationMessage>
                        </Template>
                    </FormItem>
                    <FormItem Field="@nameof(User.Password)">
                        <Template>
                            <label for="pass" class="k-label k-form-label">Password*:</label>
                            <TelerikTextBox Id="pass" @bind-Value="@TestUser.Password" Password="true"></TelerikTextBox>
                            <TelerikValidationMessage For="@(() => TestUser.Password)"></TelerikValidationMessage>
                        </Template>
                    </FormItem>
                    <FormItem Field="@nameof(User.BirthDate)" />
                    <FormItem Field="@nameof(User.AcceptTerms)" />
                </FormGroup>
                <FormGroup LabelText="Shipping Address" Id="shipaddress">
                    <FormItem LabelText="Country*: " Field="@nameof(User.Country)" />
                    <FormItem LabelText="City*: " Field="@nameof(User.City)" />
                    <FormItem LabelText="Address Line*: " Field="@nameof(User.AddressLine)" />
                    <FormItem LabelText="Second Address Line: " Field="@nameof(User.AddressLine2)" />
                </FormGroup>
            </FormItems>
        </TelerikForm>
Completed
Last Updated: 04 Apr 2024 15:40 by Chris
Release 4.2.0 (04/26/2023)
Created by: Stewart
Comments: 16
Category: Form
Type: Bug Report
16

When I updated to the latest version I noticed that the FormItems in AuthorizedViews were moved to the bottom of the form, Quick example:

<TelerikForm>
    <FormItems>
        <AuthorizeView>
            <Authorized>
                <FormItem Field="First"/>
            </Authorized>
        </AuthorizeView>
        <FormItem Field="Second"/>
    </FormItems>
</TelerikForm>

will end up like

<TelerikForm>
    <FormItems>
        <FormItem Field="Second"/>
        <FormItem Field="First"/>
    </FormItems>
</TelerikForm>

Unplanned
Last Updated: 20 Nov 2023 14:14 by Greg

My Nullable DateOnly field shows as 1/1/2001 - I would expect it to be a more sensible default. The problem is applicable only for the Form autogenerated DatePicker. The same issue is applicable for the TimeOnly type.

 

===ADMIN EDIT===

In the interim, as a viable workaround, you can utilize the FormItem Template and declare a TelerikDatePicker like this:

@using System.ComponentModel.DataAnnotations

<TelerikForm Model="@PersonModel">
    <FormValidation>
        <DataAnnotationsValidator></DataAnnotationsValidator>
    </FormValidation>
    <FormItems>
        <FormItem>
            <Template>
                <label for="country">Date of Birth:</label>
                <TelerikDatePicker @bind-Value="@PersonModel.DOB" Width="200px" />
            </Template>
        </FormItem>
    </FormItems>
</TelerikForm>

@code {
    private Person PersonModel { get; set; } = new Person() { DOB = null };

    public class Person
    {
        [Display(Name = "Date of Birth")]
        public DateOnly? DOB { get; set; }
    }
}

 

Completed
Last Updated: 06 Jun 2023 13:29 by ADMIN
Created by: Peter
Comments: 1
Category: Form
Type: Bug Report
0

https://docs.telerik.com/blazor-ui/components/form/formitems/formitemstemplate

Render defined Form items inside a FormItemsTemplate  Example

Line 22 has @nameof(Person.Id) which generates an error, should be without the @ as shown below.


 <TelerikFormItemRenderer Item="@( formItems.First(x => x.Field == nameof(Person.Id)) )" />


 

Duplicated
Last Updated: 24 Mar 2023 13:46 by ADMIN

I have a rather large TelerikForm that contains multiple TelerikTabStrip controls that contain FormItems. In the new version 4.1.0  the form items in the tabstrip do not display correctly and the form items not in the tabs are moved to the bottom of the page. The markup in a test project i created shows the tabstrip above and outside the form tag. Works correctly in 4.0.1. I've attached the test razor file.

Completed
Last Updated: 15 Mar 2023 08:31 by ADMIN
Release 4.1.0 (15/03/2023)

Here is a TelerikForm with a FormItem (1) for a boolean field. Another FormItem (2) should render, depending on the boolean field (1). This does not work with a TelerikForm, but works with a standard EditForm.

The workaround for a TelerikForm is to use a FormItem Template with a TelerikCheckBox. This is demonstrated below as well.

<EditForm Model="@_data">
    <label>Condition 1 (InputCheckbox):</label>
    <InputCheckbox @bind-Value="@_data.Value1" />
    <br />
    @if (_data.Value1)
    {
        <label>Result 2</label>
        <InputCheckbox DisplayName="Result 2:" @bind-Value="@_data.Value2"></InputCheckbox>
    }
</EditForm>

<h1>TelerikForm</h1>

<TelerikForm Model="@_data">
    <FormItems>
        <FormItem LabelText="Condition 1 (FormItem):" Field="@nameof(_data.Value1)"></FormItem>
        <FormItem>
            <Template>
                <label for="x">Condition 1 (TelerikCheckBox):</label>
                <br />
                <TelerikCheckBox Id="x" @bind-Value="_data.Value1" />
            </Template>
        </FormItem>
        @if (_data.Value1)
        {
            <FormItem LabelText="Result 2:" Field="@nameof(_data.Value2)"></FormItem>
        }
    </FormItems>
</TelerikForm>

@code {
    private ExampleDto _data { get; set; } = new ExampleDto();

    public class ExampleDto
    {
        public string TextValue { get; set; }
        public bool Value1 { get; set; }
        public bool Value2 { get; set; }
    }
}

Completed
Last Updated: 03 Mar 2023 07:26 by ADMIN
Release 4.1.0 (15/03/2023)
I am using a Grid inside a Form. When I click a page number button inside the Pager, the Form is submitted.
Completed
Last Updated: 24 Feb 2023 20:47 by ADMIN
Release 4.1.0 (15/03/2023)
Under Review
Last Updated: 31 Aug 2022 12:10 by ADMIN
Created by: Stewart
Comments: 3
Category: Form
Type: Bug Report
1

Hi, 

I came across some unusual behaviour

I wanted to hide the default form submit button so I could put it elsewhere on the page but once I had an empty FormButton element on the page I was unable to print any more

<FormButtons></FormButtons>

a solution to my problem was to put an empty span in the element

<FormButtons><span></span></FormButtons>

Completed
Last Updated: 11 Apr 2022 11:51 by ADMIN
Release 3.2.0

The Validation does not trigger when I load my model from an async method.

 

<AdminEdit>

A workaround for the time being:

@inject HttpClient http
@using System.ComponentModel.DataAnnotations

<TelerikForm @ref="@EditForm" 
             Model="@TheCatFactTelerik" 
             ValidationMessageType="@FormValidationMessageType.None">
    <FormValidation>
        <ValidationSummary />
    </FormValidation>
    <FormItems>
        <FormItem Field="fact">
        </FormItem>
    </FormItems>
    <FormButtons>
        <TelerikButton ButtonType="ButtonType.Submit" Primary="true">Apply</TelerikButton>
    </FormButtons>
</TelerikForm>

@code {
    public TelerikForm EditForm { get; set; }

    public CatFact TheCatFactTelerik = new CatFact();

    public EditContext editContext { get; set; }

    protected async override Task OnInitializedAsync()
    {
        TheCatFactTelerik = await http.GetFromJsonAsync<CatFact>("https://catfact.ninja/fact");
    }

    protected override async Task OnAfterRenderAsync(bool firstRender)
    {
        EditForm.EditContext.AddDataAnnotationsValidation();
    }

    public class CatFact
    {
        [Required(ErrorMessage = "Required Error Text")]
        [MinLength(10, ErrorMessage = "Min Length 10")]
        public string fact { get; set; }
        public int length { get; set; }
    }
}

</AdminEdit>

Declined
Last Updated: 16 Mar 2021 15:58 by ADMIN
Created by: Stewart
Comments: 2
Category: Form
Type: Bug Report
0

I have a simple TelerikForm using required validation but for some reason when I set the model via an async call to the server the validation doesn't fire. I am using the same form when I add a new item and the validation is working fine.