Skip to content

Commit f0bbf09

Browse files
committed
Use the current assigned action on opening the change form
1 parent 15d23b2 commit f0bbf09

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

PatternFileMover/Form2.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,17 @@ namespace PatternFileMover
55
{
66
public partial class Form2 : Form
77
{
8-
public Form2()
8+
public Form2(int? currentValue)
99
{
1010
InitializeComponent();
1111

1212
comboBox1.DataSource = AvailableActionItems.getAvailableActions();
1313
comboBox1.DisplayMember = "DisplayName";
1414
comboBox1.ValueMember = "Value";
15+
16+
if (currentValue != null) {
17+
comboBox1.SelectedIndex = (int) currentValue;
18+
}
1519
}
1620

1721
public int? getValue(bool returnNullIfUnchanged = false, string currentValue = "")

PatternFileMover/NameAssociationsForm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventA
8282
}
8383
else if (((DataGridView)sender).Columns[e.ColumnIndex].DataPropertyName == "Action")
8484
{
85-
using (var actionSelectForm = new Form2())
85+
using (var actionSelectForm = new Form2((int) dataGridView1.SelectedCells[0]?.Value))
8686
{
8787
actionSelectForm.ShowDialog();
8888

0 commit comments

Comments
 (0)