I'm having an issue with the adding a value to the SfComboBox.
Here is the scenario:
I have a list of companies. One of the fields is "Industry". I have placed the combobox on a page called AddCompany. When the page loads, I am retrieving a list of unique Industries that exist in the database and populating the combobox. The combobox value is bound to the Industry field of said company. I have set AllowCustom="true". When I begin typing in the combobox, I get a null reference exception.
Here is how I have the combobox defined:
<div class="col-12">
<SfComboBox Placeholder="Industry" AllowCustom="@true" TValue="string" TItem="string" FloatLabelType="FloatLabelType.Always" @bind-Value="@newLead.Industry" DataSource="Industries" SortOrder="Syncfusion.Blazor.DropDowns.SortOrder.Ascending" >
</SfComboBox>
</div>
And here is the code that populates it:
private Lead newLead;
private List<string> Industries = new List<string>();
protected override async Task OnInitializedAsync()
{
newLead = new Lead();
Industries = await wsService.GetIndustriesAsync();
}
The page loads fine. All the expected items are in the combobox. But when I try to type in the box, I get the error. Am I miisi
Hi Michael,
Thank you for reaching out to us and providing the details of the issue you're encountering with the SfComboBox on the AddCompany page. We appreciate your efforts in explaining the scenario and providing the code snippets.
After carefully reviewing your code, we have created a sample based on the information you shared. However, we couldn't replicate the issue at our end, as the provided code seems to be correctly implemented. The combobox loads the expected items, but we understand that you're experiencing a null reference exception when typing in the box.
To better assist you, we kindly request the following:
Video Illustration:
Your collaboration is crucial in helping us identify and resolve the issue promptly. If you have any questions or encounter difficulties, please feel free to reach out. We are dedicated to ensuring a smooth experience with our components.
Looking forward to your response.
The issue I am having is that when I try to type something that is NOT in the list, an exception is thrown.
For example, If I have 4 items in the combobox, English, Spanish, Italian, French. If I try to type German, It will throw an exception.
Hi Michael,
Thank you for providing additional details regarding the issue you're facing with the ComboBox. We appreciate your cooperation.
Unfortunately, we were unable to replicate the issue on our end based on the information provided. To assist you more effectively, we kindly request you to modify the provided sample according to your specific scenario where the exception occurs. Additionally, if possible, please share a video illustration of the issue to help us better understand and address the problem.
[Video illustration]
Once we have the modified sample and video illustration, we will be better equipped to identify and resolve the exception issue promptly.
Thank you for your cooperation, and we look forward to assisting you further.