Hi,
I have a data grid and this dropdown is inside one of the columns. I want to pass the value of drop down to this grid column. Is there a way to do it?
...
<RadzenDataGridColumn TItem="OrderDetail" Property="VendorName" Title="Vendor" Width="200px">
<EditTemplate Context="orderDetail">
<RadzenDropDownDataGrid TValue="string" AllowFiltering="true" AllowClear="true" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" FilterOperator="StringFilterOperator.StartsWith"
Data=@_vendors Count="5" TextProperty="Name" ValueProperty="Name"
Class="w-100" @bind-Value="orderDetail.VendorName"/>
<RadzenRequiredValidator Text="Vendor Name is required" Component="VendorName" Popup="true" Style="position: absolute"/>
</EditTemplate>
</RadzenDataGridColumn>
...
I am getting this error;
System.InvalidOperationException: Cannot find component with Name VendorName
at Radzen.Blazor.ValidatorBase.ValidateModel(Object sender, ValidationRequestedEventArgs args)
at Microsoft.AspNetCore.Components.Forms.EditContext.Validate()
at Radzen.Blazor.RadzenDataGrid`1.UpdateRow(TItem item)
at IMS.WebApp.Pages.Orders.OrderList.SaveRowDetail(OrderDetail orderDetail) in C:\Users\197199\Source\Repos\IMS.WebApp\IMS.WebApp\Pages\Orders\OrderList.razor:line 370
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Radzen.Blazor.RadzenButton.OnClick(MouseEventArgs args)
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
While trying to save;
<EditTemplate Context="detail">
<RadzenButton Icon="check" ButtonStyle="ButtonStyle.Primary" Class="m-1" Click="@(args => SaveRowDetail(detail))">
</RadzenButton>
</EditTemplate>
.....
async Task SaveRowDetail(OrderDetail orderDetail)
{
if (orderDetail == _detailToInsert)
{
_detailToInsert = null;
}
await _gridDetail.UpdateRow(orderDetail);
}
Do OrderDetail and Vendor entities have to have a relationship in order to save? I look forward to your help and guidance.
Thank you.