[Mono-bugs] [Bug 583387] DataGridView.Columns.Insert inserts after given index
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Mon Apr 26 06:19:31 EDT 2010
http://bugzilla.novell.com/show_bug.cgi?id=583387
http://bugzilla.novell.com/show_bug.cgi?id=583387#c4
Willem-Jan de Hoog <wdehoog at exalondelft.nl> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |
--- Comment #4 from Willem-Jan de Hoog <wdehoog at exalondelft.nl> 2010-04-26 10:19:30 UTC ---
It's actually worse now since it crashes. I used the dll you attached here
--- Comment #5 from Ivan Zlatev <ivan at ivanz.com> 2010-04-24 23:49:08 UTC ---
Created an attachment (id=356668)
--> (http://bugzilla.novell.com/attachment.cgi?id=356668)
--> (http://bugzilla.novell.com/attachment.cgi?id=356668)
When I execute this code (on a form with a DataGridView):
protected void testAddColumn() {
try {
// setup data grid view
dataGridView1.ColumnCount = 6;
dataGridView1.ColumnHeadersVisible = true;
// Set the column header names.
dataGridView1.Columns[0].Name = "ProjectId";
dataGridView1.Columns[1].Name = "EmployeeId";
dataGridView1.Columns[2].Name = "StartDate";
dataGridView1.Columns[3].Name = "StartTime";
dataGridView1.Columns[4].Name = "Duration";
dataGridView1.Columns[5].Name = "Task";
// Populate the rows.
string[] row1 = new
string[]{"1","1","2010-2-24","9:00:00","8:00:00","Testing"};
string[] row2 = new string[] { "1", "1", "2010-2-25", "9:00:00",
"8:00:00", "Testing" };
string[] row3 = new string[] { "1", "2", "2010-2-24", "9:00:00",
"8:00:00", "Testing" };
string[] row4 = new string[] { "2", "2", "2010-2-24", "9:00:00",
"8:00:00", "Testing" };
object[] rows = new object[] { row1, row2, row3, row4};
foreach(string[] rowArray in rows) {
dataGridView1.Rows.Add(rowArray);
}
// add new text column
DataGridViewTextBoxColumn idColumn = new DataGridViewTextBoxColumn();
idColumn.Name = "TextThingy";
dataGridView1.Columns.Insert(1, idColumn);
} catch(Exception ex) {
MessageBox.Show(String.Format("Error loading data. {0}", ex.Message),
"Accessing Data", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
mono --debug results in a crash and:
System.ArgumentOutOfRangeException: Index is less than 0 or more than or equal
t
o the list count.
Parameter name: index
6
at System.Collections.ArrayList.ThrowNewArgumentOutOfRangeException
(System.St
ring name, System.Object actual, System.String message) [0x00000] in
C:\cygwin\t
mp\monobuild\build\BUILD\mono-2.6\mcs\class\corlib\System.Collections\ArrayList.
cs:3261
at System.Collections.ArrayList.get_Item (Int32 index) [0x00013] in
C:\cygwin\
tmp\monobuild\build\BUILD\mono-2.6\mcs\class\corlib\System.Collections\ArrayList
cs:2652
at System.Windows.Forms.DataGridViewCellCollection.get_Item (Int32 index)
[0x0
0000] in
/home/ivanz/src/git/mcs/class/Managed.Windows.Forms/System.Windows.Form
s/DataGridViewCellCollection.cs:53
at (wrapper remoting-invoke-with-check)
System.Windows.Forms.DataGridViewCellC
ollection:get_Item (int)
at System.Windows.Forms.DataGridViewRow.PaintCells (System.Drawing.Graphics
gr
aphics, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex,
DataGridViewE
lementStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow,
Da
taGridViewPaintParts paintParts) [0x0009b] in
/home/ivanz/src/git/mcs/class/Mana
ged.Windows.Forms/System.Windows.Forms/DataGridViewRow.cs:567
at System.Windows.Forms.DataGridViewRow.Paint (System.Drawing.Graphics
graphic
s, Rectangle clipBounds, Rectangle rowBounds, Int32 rowIndex,
DataGridViewElemen
tStates rowState, Boolean isFirstDisplayedRow, Boolean isLastVisibleRow)
[0x0008
d] in
/home/ivanz/src/git/mcs/class/Managed.Windows.Forms/System.Windows.Forms/D
ataGridViewRow.cs:538
at System.Windows.Forms.DataGridView.OnPaint
(System.Windows.Forms.PaintEventA
rgs e) [0x00314] in
/home/ivanz/src/git/mcs/class/Managed.Windows.Forms/System.W
indows.Forms/DataGridView.cs:4759
at System.Windows.Forms.Control.WmPaint (System.Windows.Forms.Message& m)
[0x0
008a] in
/home/ivanz/src/git/mcs/class/Managed.Windows.Forms/System.Windows.Form
s/Control.cs:5551
at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m)
[0x0
016b] in
/home/ivanz/src/git/mcs/class/Managed.Windows.Forms/System.Windows.Form
s/Control.cs:5309
at System.Windows.Forms.DataGridView.WndProc (System.Windows.Forms.Message&
m)
[0x00000] in
/home/ivanz/src/git/mcs/class/Managed.Windows.Forms/System.Windows
Forms/DataGridView.cs:5723
at System.Windows.Forms.Control+ControlWindowTarget.OnMessage
(System.Windows.
Forms.Message& m) [0x00000] in
/home/ivanz/src/git/mcs/class/Managed.Windows.For
ms/System.Windows.Forms/Control.cs:234
at System.Windows.Forms.Control+ControlNativeWindow.WndProc
(System.Windows.Fo
rms.Message& m) [0x00000] in
/home/ivanz/src/git/mcs/class/Managed.Windows.Forms
/System.Windows.Forms/Control.cs:215
at System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr
wPa
ram, IntPtr lParam) [0x00085] in
/home/ivanz/src/git/mcs/class/Managed.Windows.F
orms/System.Windows.Forms/NativeWindow.cs:242
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list