<h3>Test</h3>
<SfComboBox TValue="int?" TItem="Countries" DataSource="@Country">
<ComboBoxFieldSettings Text="Name" Value="Code "></ComboBoxFieldSettings>
<ComboBoxEvents TValue="int?" TItem="Countries" CustomValueSpecifier="@customValue"></ComboBoxEvents>
</SfComboBox>
@code{
private void customValue(CustomValueSpecifierEventArgs<Countries> args)
{
args.Item = new Countries() { Code = 22, Name = args.Text };
}
public class Countries
{
public string Name { get; set; }
public int Code { get; set; }
}
private List<Countries> Country = new List<Countries>
{
new Countries() { Name = "Australia", Code = 1 },
new Countries() { Name = "Bermuda", Code = 2 },
new Countries() { Name = "Canada", Code = 3 },
new Countries() { Name = "Cameroon", Code= 4 },
};
} |
Hi Dave,
We can replicate the reported issue in our end with the provided information. We have consider this as a defect in our end, the fix for the issue will be included in the upcoming patch release scheduled on October 28, 2020. You can track the status of the issue in the following feedback link
Regards,Prince
<SfComboBox @ref="comboboxObj" TValue="int?" TItem="Countries" ShowClearButton="false" Placeholder="e.g. Australia" Autofill="true" @bind-Value="@ComboVal" DataSource="@Country">
<ComboBoxFieldSettings Text="Name" Value="Code"></ComboBoxFieldSettings>
<ComboBoxEvents TValue="int?" TItem="Countries" ValueChange="onChange" CustomValueSpecifier="@customValue"></ComboBoxEvents>
</SfComboBox>
@code {
...
private void customValue(CustomValueSpecifierEventArgs<Countries> args)
{
args.Item = new Countries() { Code = 22, Name = args.Text };
}
...
} |
<SfComboBox @ref="comboboxObj" TValue="int?" AllowCustom="false" TItem="Countries" ShowClearButton="false" Placeholder="e.g. Australia" Autofill="true" @bind-Value="@ComboVal" DataSource="@Country">
<ComboBoxFieldSettings Text="Name" Value="Code"></ComboBoxFieldSettings>
<ComboBoxEvents TValue="int?" TItem="Countries" ValueChange="onChange"></ComboBoxEvents>
</SfComboBox> |