MultiSelect Error When Selecting Value

Hi,


I'm using the multiselect component in the datagrid popup editor and data is showing up ok in the list from my data source, however when I click the checkbox, it's producing the following error:

System.NullReferenceException: Object reference not set to an instance of an object.   at Syncfusion.Blazor.Grids.Internal.Editors.ColumnsValidator`1.ValidateField(Object editContext, FieldChangedEventArgs fieldChangedEventArgs)   at Microsoft.AspNetCore.Components.Forms.EditContext.NotifyFieldChanged(FieldIdentifier& fieldIdentifier)   at Syncfusion.Blazor.Internal.SfBaseUtils.ValidateExpression[T](EditContext editContext, Expression`1 expression)   at Syncfusion.Blazor.Internal.SfBaseUtils.UpdateProperty[T](T publicValue, T privateValue, EventCallback`1 eventCallback, EditContext editContext, Expression`1 expression)   at Syncfusion.Blazor.DropDowns.SfMultiSelect`2.UpdateItemValue()   at Syncfusion.Blazor.DropDowns.SfMultiSelect`2.AddValue(ListOptions`1 item, EventArgs args, KeyboardEventArgs keyArgs)   at Syncfusion.Blazor.DropDowns.SfMultiSelect`2.UpdateSelectedItem(ListOptions`1 item, EventArgs args, KeyboardEventArgs keyArgs, Boolean isGroupBy, Boolean isGroupHeader)   at Syncfusion.Blazor.DropDowns.SfMultiSelect`2.OnMouseClick(ListOptions`1 args, MouseEventArgs eventArgs)   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

I'm unsure of why this is occurring. I have an event set up to capture value changes and this error shows up immediately, and the event doesn't fire. 

I have attached the code files used in all of this. 


Any help is appreciated!


Attachment: MultiSelectError_88bb7d45.zip

5 Replies

SP Sureshkumar P Syncfusion Team February 16, 2022 12:34 PM UTC

Evan, 
 
Based on your request we have rendered ResourcesDropdown component in Grid Dialog template edit dialog. But we cannot replicate the reported issue from our end. please find the sample code and sample link here. 
 
<SfGrid DataSource="@Orders" Toolbar="@(new string[] {"Add""Edit" ,"Delete","Update","Cancel" })"  
        AllowSorting="true" AllowGrouping="true" AllowFiltering="true" AllowPaging="true"AllowTextWrap="true" Width="100%"  
            >  
    <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true"Mode="@EditMode.Dialog">  
        <Template>  
            @{  
                var Order = (context as Order);  
                <div>  
                    . . .  
                    <div class="form-row">  
                        <div class="form-group col-md-6">  
                            <label class="e-float-text e-label-top">ChosenItems</label>  
                            <ResourcesDropdown @bind-SelectedResources="@(Order.ChosenItems)"></ResourcesDropdown>  
                        </div>  
                    </div>  
                    .. .   
                </div>  
            }  
        </Template>  
    </GridEditSettings>  
    <GridColumns>  
        <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true"TextAlign="@TextAlign.Center" HeaderTextAlign="@TextAlign.Center" Width="140"></GridColumn>  
        <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" Width="150"></GridColumn>  
        <GridColumn Field=@nameof(Order.ChosenItems) HeaderText="Chosen Items" Width="150">  
            <Template>  
                @{  
                    var d = (context as Order).ChosenItems;  
                    <span>@String.Join(",", d)</span>  
                }  
            </Template>  
        </GridColumn>  
        <GridColumn Field=@nameof(Order.ShipCountry) HeaderText="Ship Country" Width="150"></GridColumn>  
    </GridColumns>  
</SfGrid>  
 
 
 
 
If still you have faced the issue, then please replicate your facing issue in the above attached sample and revert us the issue replicated sample with issue replication procedure these details will help us to provide exact solution as earlier as possible.  
 
Regards, 
Sureshkumar P 
 



EB Evan Boyle February 16, 2022 09:15 PM UTC

Hey Sureshkumar,


So I could not replicate this issue with your package, however I could​ fix it in my own app by changing the package version. I was using 19.4.0.52 (latest) and the issue is there but when I rolled everything back to the same version as your sample (19.4.0.48) it is working just fine. Could you try to bump the version to the latest build on your side to confirm if you can see the issue I was facing?


Thanks,


Evan



RN Rahul Narayanasamy Syncfusion Team February 17, 2022 05:03 PM UTC

Hi Evan, 
 
Thanks for sharing the details. 
 
We are currently checking the reported case from our end and we will update the further details within one business days. Until then we appreciate your patience. 
 
Regards, 
Rahul 



RN Rahul Narayanasamy Syncfusion Team February 18, 2022 10:47 AM UTC

Hi Evan, 

Thanks for your patience. 

We have considered your query as a bug and logged the defect report “Exception throws while selecting a value in custom component(MultiSelect) which is rendered in DialogTemplate” for the same. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle) and will include the fix in our upcoming patch release which is expected to be rolled out on or before February 23, 2022. Until then we appreciate your patience.  
  
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.   


Regards 
Rahul 



RN Rahul Narayanasamy Syncfusion Team February 23, 2022 12:21 PM UTC

Hi Evan,  

We are glad to announce that, we have resolved the reported issue “Exception throws while selecting a value in custom component(MultiSelect) which is rendered in DialogTemplate” in our release(19.4.0.53).  So please upgrade to our latest version of Syncfusion NuGet package to resolve the reported issue. Please find the Nuget package for latest fixes and features from below.  



We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.   
    
Regards,              
Rahul 
 


Loader.
Up arrow icon