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