Error in Grid when using dropdown component


Hello,

In version 18.2.46, when using a dropdown component inside a grid column, the validationrules message is showing despite having a value populated in fields.




This is a sample of one of the column pattern:

     <GridColumn Field=@nameof(People.PersonIdType) HeaderText="Tipo de Id" ValidationRules="@(new ValidationRules{ Required=true })" Visible="@mainFields" AutoFit="true">
<Template>
@{
var peopleContext = context as People;
if (@peopleContext.PersonIdTypeNavigation != null) {
<span>@peopleContext.PersonIdTypeNavigation.IdDescription</span>
}
}
</Template>
<EditTemplate>
Tipo de Id
<SfDropDownList ID="PersonIdType" TItem="Idtypes" TValue="string" Placeholder="Tipo de Id" Index="@idtypesIndex">
<SfDataManager Url=@($"{apiURL}/idtypes") Adaptor="Adaptors.ODataV4Adaptor" CrossDomain="true" Offline="true"></SfDataManager>
<DropDownListFieldSettings Value="Id" Text="IdDescription"></DropDownListFieldSettings>
</SfDropDownList>
</EditTemplate>
</GridColumn>

Regards,

erick



1 Reply 1 reply marked as answer

RN Rahul Narayanasamy Syncfusion Team July 30, 2020 02:28 PM UTC

Hi Erick, 
 
Greetings from Syncfusion. 
 
Query: In version 18.2.46, when using a dropdown component inside a grid column, the validationrules message is showing despite having a value populated in fields. 
 
We have validated your query and checked the reported problem at our end. You can resolve the reported problem by providing  @bind-Value to SfDropdownlist. Find the below code snippets  for your reference. 
 
 
<SfGrid AllowPaging="true" DataSource="@Orders" Toolbar="@(new List<string>() { "Add""Edit""Delete""Cancel""Update" })">    <GridEditSettings AllowEditing="true" AllowDeleting="true" AllowAdding="true" Mode="@EditMode.Dialog"></GridEditSettings>    <GridColumns>        <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" ValidationRules="@(new ValidationRules{ Required=true})" IsPrimaryKey="true" TextAlign="@TextAlign.Center" Width="140"></GridColumn>        <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150" EditType="EditType.DropDownEdit" ValidationRules="@(new ValidationRules{ Required=true})">            <Template>                    . . .                </Template>            <EditTemplate>                <SfDropDownList ID="CustomerID" @ref="AutoCompletObj" TValue="string" @bind-Value="@((context as Order).CustomerID)" TItem="Order">                    <SfDataManager AdaptorInstance="@typeof(CustomAdaptor)" Adaptor="Adaptors.CustomAdaptor"></SfDataManager>                    <DropDownListFieldSettings Value="CustomerID"></DropDownListFieldSettings>                </SfDropDownList>            </EditTemplate>         </GridColumn>        . . .    </GridColumns></SfGrid>
 
 
Please get back to us if you need further assistance. 
 
Regards, 
Rahul 


Marked as answer
Loader.
Up arrow icon