mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-09 15:56:40 -05:00
Fix parse type on different columns
ColumnValue1 is long ColumnValue2 is ulong a value > long.MaxValue in ColumnValue2 would popup an error message on form load. now fixed
This commit is contained in:
@@ -370,7 +370,9 @@ private void ValidateCell(object? sender, DataGridViewCellEventArgs e)
|
||||
var row = Grid.Rows[e.RowIndex];
|
||||
var cell = row.Cells[e.ColumnIndex];
|
||||
var text = cell.Value?.ToString() ?? string.Empty;
|
||||
if (long.TryParse(text, CultureInfo.InvariantCulture, out _))
|
||||
if (e.ColumnIndex is ColumnValue1 && long.TryParse(text, CultureInfo.InvariantCulture, out _))
|
||||
return;
|
||||
if (e.ColumnIndex is ColumnValue2 && ulong.TryParse(text, CultureInfo.InvariantCulture, out _))
|
||||
return;
|
||||
WinFormsUtil.Alert("Please enter a valid value.");
|
||||
var i = Convert.ToInt32(row.Cells[ColumnIndex].Value);
|
||||
|
||||
Reference in New Issue
Block a user