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
17

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>

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)) )" />


 

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)
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>