You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did it work in any of the earlier releases of .NET Core or .NET 5+?
Not sure
Issue description
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Windows.Forms.PropertyGridInternal.PropertyGridView.DoubleClickRow(Int32 row, Boolean toggleExpand, Int32 type)
at System.Windows.Forms.PropertyGridInternal.GridEntry.OnMouseClick(Int32 x, Int32 y, Int32 count, MouseButtons button)
at System.Windows.Forms.PropertyGridInternal.PropertyGridView.OnMouseDown(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.PropertyGridInternal.PropertyGridView.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)
@Zheng-Li01:
The issue was found in the error log. I'm not sure how to re-create the issue.
The Exception is thrown on line 1310:
CommitValue(values[index]);
Cause:
The following code does not take into account that the array could be empty (line 1301): if (index >= (values.Length - 1)) { index = 0; } else { index++; }
--
The array (which could be empty) is returned from (line 1464):
///
/// Returns the standard text values of this property.
///
public virtual object[] GetPropertyValueList()
{
if (TypeConverter.GetStandardValues(this) is { } values)
{
object[] valueArray = new object[values.Count];
values.CopyTo(valueArray, 0);
return valueArray;
}
@ulfemsoy thanks for your update. create the sample project based on your description with the help of Copilot but failed. attached the reproduce application, could you please have a check and try to modify it to help reproduce the issue.
@KlausLoeffelmann@LeafShi1 Verified this issue still repro for PropertyGridView.DoubleClickRow and PropertyGridView.OnMouseWheel in .NET framework 4.8.1/4,7. It's not a regression in .NET versions.
Tested in the latest .NET 11 RC2 build: 11.0.100-rc.2.26453.107 + built private dls from the main branch of WinForms repo, it was fixed. No IndexOutOfRangeException throw for PropertyGridView.DoubleClickRow.
Activity
Zheng-Li01 commentedon Dec 25, 2025
@ulfemsoy could you please provide more details to help reproduce the issue, such as stable steps or sample project?
ulfemsoy commentedon Dec 25, 2025
@Zheng-Li01:
The issue was found in the error log. I'm not sure how to re-create the issue.
The Exception is thrown on line 1310:
CommitValue(values[index]);Cause:
The following code does not take into account that the array could be empty (line 1301):
if (index >= (values.Length - 1)) { index = 0; } else { index++; }--
The array (which could be empty) is returned from (line 1464):
///
/// Returns the standard text values of this property.
///
public virtual object[] GetPropertyValueList()
{
if (TypeConverter.GetStandardValues(this) is { } values)
{
object[] valueArray = new object[values.Count];
values.CopyTo(valueArray, 0);
return valueArray;
}
}
Zheng-Li01 commentedon Dec 26, 2025
@ulfemsoy thanks for your update. create the sample project based on your description with the help of Copilot but failed. attached the reproduce application, could you please have a check and try to modify it to help reproduce the issue.
ExceptionRepo.zip
KlausLoeffelmann commentedon Mar 18, 2026
If this worked in NetFX, what regressed it?
@Olina-Zhang, @LeafShi1 FYI.
Olina-Zhang commentedon Mar 18, 2026
@KlausLoeffelmann @LeafShi1 Verified this issue still repro for
PropertyGridView.DoubleClickRowandPropertyGridView.OnMouseWheelin .NET framework 4.8.1/4,7. It's not a regression in .NET versions.default.NETframework_repro.mp4
Amy-Li03 commentedon Sep 4, 2026
Tested in the latest .NET 11 RC2 build: 11.0.100-rc.2.26453.107 + built private dls from the main branch of WinForms repo, it was fixed. No IndexOutOfRangeException throw for
PropertyGridView.DoubleClickRow.