mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-03-21 17:48:28 -05:00
Single row select
Previously allowed cells and allowed multiple to be selected, resulting in some issues if users selected multiple cells and tried to trigger an open via contextmenu opening.
This commit is contained in:
parent
6e48856bec
commit
e56226f046
|
|
@ -95,8 +95,10 @@ private void InitializeComponent()
|
|||
dgDataRecent.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
dgDataRecent.Location = new Point(0, 0);
|
||||
dgDataRecent.Margin = new System.Windows.Forms.Padding(0);
|
||||
dgDataRecent.MultiSelect = false;
|
||||
dgDataRecent.Name = "dgDataRecent";
|
||||
dgDataRecent.RowHeadersVisible = false;
|
||||
dgDataRecent.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
dgDataRecent.Size = new Size(616, 331);
|
||||
dgDataRecent.TabIndex = 2;
|
||||
dgDataRecent.CellMouseDown += DataGridCellMouseDown;
|
||||
|
|
@ -124,8 +126,10 @@ private void InitializeComponent()
|
|||
dgDataBackup.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
|
||||
dgDataBackup.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
dgDataBackup.Location = new Point(0, 0);
|
||||
dgDataBackup.MultiSelect = false;
|
||||
dgDataBackup.Name = "dgDataBackup";
|
||||
dgDataBackup.RowHeadersVisible = false;
|
||||
dgDataBackup.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
dgDataBackup.Size = new Size(616, 331);
|
||||
dgDataBackup.TabIndex = 1;
|
||||
dgDataBackup.CellMouseDown += DataGridCellMouseDown;
|
||||
|
|
|
|||
|
|
@ -223,11 +223,11 @@ private void ClickOpenFolder(DataGridView dgv)
|
|||
|
||||
private SavePreview? GetSaveFile(DataGridView dgData)
|
||||
{
|
||||
var c = dgData.SelectedCells;
|
||||
var c = dgData.SelectedRows;
|
||||
if (c.Count != 1)
|
||||
return null;
|
||||
|
||||
var item = c[0].RowIndex;
|
||||
var item = c[0].Index;
|
||||
var parent = dgData == dgDataRecent ? Recent : Backup;
|
||||
return parent[item];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user