Article ID: 321556 - View products that this article applies to.
This article was previously published under Q321556
When you double-click a row divider in a DataGrid control in a Visual Studio .NET Windows application that uses the .NET common language runtime, if the cells of the DataGrid are empty, you receive the following error message:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex
at System.Globalization.CompareInfo.IndexOf(String source, String value, Int32 startIndex)
at System.Windows.Forms.DataGridTextBoxColumn.GetPreferredHeight(Graphics g, Object value)
at System.Windows.Forms.DataGrid.RowAutoResize(Int32 row)
at System.Windows.Forms.DataGrid.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.ControlNativeWindow.OnMessage(Message m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
This problem occurs because of a bug in the .NET Windows Forms classes.
To resolve this problem, obtain the latest service pack for Microsoft .NET Framework. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
318836The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
(http://support.microsoft.com/kb/318836/EN-US/ )INFO: How to Obtain the Latest .NET Framework Service Pack
Date Time Version Size File Name ------------------------------------------------------------------------ 23-Apr-2002 19:11:46 1.0.3705.264 1,982,464 System.Windows.Forms.dll 23-Apr-2002 7:32:48 1.0.3705.264 57,344 System.Windows.Forms.tlb 23-Apr-2002 7:38:06 16,644 System.Windows.Forms.ldo
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft .NET Framework Service Pack 2 (SP2).
Article ID: 321556 - Last Review: April 7, 2006 - Revision: 3.0
Contact us for more help
Connect with Answer Desk for expert help.