[Mono-bugs] [Bug 80293][Min] New - the DataGridView.DataSource property should take in account the AutoGenerateColumns property value
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Sun Dec 17 19:03:22 EST 2006
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by catanzariti at yahoo.com.
http://bugzilla.ximian.com/show_bug.cgi?id=80293
--- shadow/80293 2006-12-17 19:03:22.000000000 -0500
+++ shadow/80293.tmp.24933 2006-12-17 19:03:22.000000000 -0500
@@ -0,0 +1,42 @@
+Bug#: 80293
+Product: Mono: Class Libraries
+Version: 1.2
+OS:
+OS Details: Ubuntu 6.10
+Status: NEW
+Resolution:
+Severity:
+Priority: Minor
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com
+ReportedBy: catanzariti at yahoo.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: the DataGridView.DataSource property should take in account the AutoGenerateColumns property value
+
+namespace : Windows.Forms
+class : DataGridView
+property : DataSource
+
+When assigning the DataSource property with a collection supporting the
+IList interface, the DataGridView component add new columns by
+introspecting first item of the list (method BindIList) even if the
+AutoGenerateColumns property is set to false.
+
+This is an implementation proposal of DataGridView.BindIList :
+
+private void BindIList (IList list) {
+ if (list.Count > 0 && AutoGenerateColumns) {
+ DataGridViewCell template = new DataGridViewTextBoxCell();
+ foreach (PropertyDescriptor property in
+TypeDescriptor.GetProperties(list[0])) {
+ DataGridViewColumn col = new DataGridViewColumn(template);
+ col.Name = property.DisplayName;
+ columns.Add(col);
+ }
+ }
+...
+
+}
More information about the mono-bugs
mailing list