+2009-03-19 Ivan N. Zlatev <contact@i-nz.net>
+
+ * DataGridView.cs, DataGridViewColumn.cs: Do not set Row/CellTemplate's
+ DataGridView. They do not belong to a DataGridView.
+ [Fixes bug #486645]
+
2009-03-19 Ivan N. Zlatev <contact@i-nz.net>
* DataGridViewCellCollection.cs, DataGridViewColumnCollection.cs:
}
set {
rowTemplate = value;
- rowTemplate.SetDataGridView(this);
}
}
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public virtual DataGridViewCell CellTemplate {
get { return cellTemplate; }
- set {
- cellTemplate = value;
- if (DataGridView != null) {
- cellTemplate.SetDataGridView(DataGridView);
- }
- }
+ set { cellTemplate = value; }
}
[Browsable (false)]
}
base.SetDataGridView (dataGridView);
- if (cellTemplate != null) {
- cellTemplate.SetDataGridView(dataGridView);
- }
headerCell.SetDataGridView(dataGridView);
}
+2009-03-19 Ivan N. Zlatev <contact@i-nz.net>
+
+ * DataGridViewTest.cs, DataGridViewColumnTest.cs: Add tests for
+ Row/CellTemplates being always null.
+
2009-03-17 Ivan N. Zlatev <contact@i-nz.net>
* DataGridViewTest.cs: Add tests for the relevance of IsHandleCreated and
}
private int columnChanged;
+
+ [Test]
+ public void CellTemplateDataGridView ()
+ {
+ DataGridView dgv = new DataGridView ();
+ DataGridViewColumn dvc = new DataGridViewTextBoxColumn ();
+ dgv.Columns.Add (dvc);
+ Assert.IsNull (dvc.CellTemplate.DataGridView, "#1");
+ }
}
}
#endif
Assert.IsTrue (dgv.IsHandleCreated, "#11");
Assert.AreEqual (0, dgv.RowCount, "#12");
}
+
+ [Test]
+ public void RowTemplateDataGridView ()
+ {
+ DataGridView gdv = new DataGridView ();
+ Assert.IsNull (gdv.RowTemplate.DataGridView, "#1");
+ }
}
[TestFixture]