Hi Team,
It worked with "press Enter" or "mouse click" but not with "tab key down".
Enter key or mouse click (selection) does fired the "value change" event to fetch itemcode and default Unit cost...
Unfortunately not with tab key down selection...
Here is my COMBOBOX Razor..
<GridForeignColumn Field=@nameof(DRdetailEdit.ItemId)
EditType="EditType.DefaultEdit"
HeaderText="Item"
ForeignKeyField="ItemId"
ForeignKeyValue="Description"
ForeignDataSource="@Items"
Width="110">
<EditTemplate>
<div @onkeydown="@(e => KeyDownHandlerItem(e))">
<SfComboBox @ref="ComboBoxItem"
ID="InventoryMasterID"
TItem="InventoryMaster"
TValue="int"
AllowCustom="false"
Autofill="true"
Placeholder="Select Product"
CssClass="e-multi-column"
AllowFiltering="true"
Width="110"
DataSource="@Items"
@bind-Value="@((context as DeliveryReceiptsDetailEdit).ItemId)">
<ComboBoxTemplates TItem="InventoryMaster">
<HeaderTemplate>
<table>
<tr>
<th class="e-text-left combo-width">Description</th>
@*<th>Description</th>*@
@*<th>UnitCost</th>
<th>Size</th>*@
</tr>
</table>
</HeaderTemplate>
<ItemTemplate Context="ComboContext">
<table>
<tbody>
<tr>
<td class="e-text-left combo-width">@((ComboContext as InventoryMaster).Description)</td>
@*<td>@((ComboContext as InventoryMaster).Description)</td>*@
</tr>
</tbody>
</table>
</ItemTemplate>
</ComboBoxTemplates>
<ComboBoxFieldSettings Value="ItemId" Text="Description"></ComboBoxFieldSettings>
<ComboBoxEvents TItem="InventoryMaster" TValue="int" Created="Created" ValueChange="OnValueChangeItem"></ComboBoxEvents>
</SfComboBox>
</div>
</EditTemplate>
<HeaderTemplate>
<div>
<span class="oi oi-fire e-icons headericon"></span> Item
</div>
</HeaderTemplate>
</GridForeignColumn>
Here is my Value change method
public async Task OnValueChangeItem(Syncfusion.Blazor.DropDowns.ChangeEventArgs<int, InventoryMaster> args)
{
var SelectedItem = args.ItemData;
if (SelectedItem != null)
{
CurrentItemID = SelectedItem.ItemId;
ItemCodeValue = SelectedItem.ItemCode;
UnitCostValue = SelectedItem.UnitCost; //Ron09172021
VatableValue = SelectedItem.Vatable; //Ron09172021
await GridDetail.UpdateCell(RowIndexDetail, "ItemCode", ItemCodeValue);
await GridDetail.UpdateCell(RowIndexDetail, "UnitCost", UnitCostValue);
await GridDetail.UpdateCell(RowIndexDetail, "Vatable", VatableValue);
}
}
Hope you guys can help me on this.
Best Regards,
Tyrone
Thanks Vignesh for the example.
I'll try some isolation. must be conflict with some other event..
Best Regards,
Tyrone