Hi team
I need help for the following..
1) How do I skip a column using tab key?..
2) Can we set focus on next column entry via Tab without double clicking it?
btw, I'm applying Batch mode.
Warm regards,
Tyrone
SfGrid<Order> Grid;
public async void KeyDownHandler(KeyboardEventArgs args, int? OrderID, string leftField)
{
if (Grid.IsEdit && args.Key == "Tab")
{ await Grid.EditCellAsync(rowIndex, leftField);
}
}
|
Thanks Renjith for the immidiate reply.
My problem is Grid.GetRowIndexByPrimaryKeyAsync(OrderID); will not work with newly added lineitem since my ID is autogenerated from EFCore after saving in database.
Is there is an alternative to get the current RowIndex?..
Warm Regards,
Tyrone
Hi Renjit,
The solution work with text box but not in combobox.
I could have missed something here?
it doesn't fire in the code block.
<GridForeignColumn Field=@nameof(SODetailEdit.ItemID)
EditType="EditType.DefaultEdit"
HeaderText="Item"
ForeignKeyField="ItemID"
ForeignKeyValue="ItemDescription"
ForeignDataSource="@Items"
Width="300">
<EditTemplate>
<SfComboBox @ref="ComboBoxItem"
ID="ItemID" TItem="Item"
TValue="int"
AllowCustom="false"
Autofill="true"
Placeholder=" Select Product"
CssClass="e-multi-column"
AllowFiltering="true"
PopupHeight="300px"
Width="300"
DataSource="@Items"
@bind-Value="@((context as SODetailEdit).ItemID)"
@onkeydown="@(e=>KeyDownHandlerItem(e, "Quantity"))"> //
<ComboBoxTemplates TItem="Item">
<HeaderTemplate>
<table>
<tr>
<th class="e-text-center combo-width">Code</th>
<th>Name</th>
<th>Description</th>
<th>Price</th>
<th>Price</th>
<th>Price</th>
<th>id</th>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate Context="ComboContext">
<table>
<tbody>
<tr>
<td class="e-text-center combo-width">@((ComboContext as Item).ItemCode)</td>
<td>@((ComboContext as Item).ItemDescription)</td>
<td>@((ComboContext as Item).Price)</td>
<td>@((ComboContext as Item).ItemID)</td>
</tr>
</tbody>
</table>
</ItemTemplate>
</ComboBoxTemplates>
<ComboBoxFieldSettings Value="ItemID" Text="ItemDescription"></ComboBoxFieldSettings>
<ComboBoxEvents TItem="Item" TValue="int" Created="Created" ValueChange="OnValueChangeItem"></ComboBoxEvents>
</SfComboBox>
</EditTemplate>
</GridForeignColumn>
<EditTemplate>
<div @onkeydown="@(e=>KeyDownHandler(e, (context as Order).OrderID,"Freight"))">
<SfComboBox ID="CustomerID" TItem="Order" ...>
...
</SfComboBox>
</div>
</EditTemplate>
|
Thanks Renjit. it worked