mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-09 11:16:11 -05:00
Inventory: Begin edit on cell select
Saves a click.
This commit is contained in:
@@ -114,6 +114,7 @@ private DoubleBufferedDataGridView GetDGV(InventoryPouch pouch)
|
||||
// Add DataGrid
|
||||
var dgv = GetBaseDataGrid(pouch);
|
||||
dgv.CellValueChanged += Dgv_CellValueChanged;
|
||||
dgv.EditingControlShowing += Dgv_EditingControlShowing;
|
||||
|
||||
// Get Columns
|
||||
var item = GetItemColumn(ColumnItem = dgv.Columns.Count);
|
||||
@@ -289,6 +290,17 @@ private void Dgv_CellValueChanged(object? sender, DataGridViewCellEventArgs e)
|
||||
IsCountValidationSuppressed = false;
|
||||
}
|
||||
|
||||
private static void Dgv_EditingControlShowing(object? sender, DataGridViewEditingControlShowingEventArgs e)
|
||||
{
|
||||
if (sender is not DataGridView dgv || e.Control is not ComboBox cb)
|
||||
return;
|
||||
|
||||
if (dgv.CurrentCell?.OwningColumn is not DataGridViewComboBoxColumn)
|
||||
return;
|
||||
|
||||
cb.DroppedDown = true;
|
||||
}
|
||||
|
||||
private void SetBag(DataGridView dgv, InventoryPouch pouch)
|
||||
{
|
||||
int ctr = 0;
|
||||
|
||||
Reference in New Issue
Block a user