+2007-08-09 Rolf Bjarne Kvinge <RKvinge@novell.com>
+
+ * DataGridViewColumn.cs: Throw if the SortMode conflicts with DataGridView's
+ SelectionMode.
+
2007-08-08 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* ListView.cs: In ListViewItemsCollection check that owner is
public DataGridViewColumnSortMode SortMode {
get { return sortMode; }
set {
- // System.InvalidOperationException: The value assigned to the property conflicts with System.Windows.Forms.DataGridView.SelectionMode.
+ if (value == DataGridViewColumnSortMode.Automatic && DataGridView != null && DataGridView.SelectionMode == DataGridViewSelectionMode.FullColumnSelect)
+ throw new InvalidOperationException ("Column's SortMode cannot be set to Automatic while the DataGridView control's SelectionMode is set to FullColumnSelect.");
+
if (sortMode != value) {
sortMode = value;
if (DataGridView != null) {
}
internal override void SetDataGridView (DataGridView dataGridView) {
- base.SetDataGridView(dataGridView);
+ if (sortMode == DataGridViewColumnSortMode.Automatic && dataGridView != null && dataGridView.SelectionMode == DataGridViewSelectionMode.FullColumnSelect) {
+ throw new InvalidOperationException ("Column's SortMode cannot be set to Automatic while the DataGridView control's SelectionMode is set to FullColumnSelect.");
+ }
+
+ base.SetDataGridView (dataGridView);
if (cellTemplate != null) {
cellTemplate.SetDataGridView(dataGridView);
}
+2007-08-09 Rolf Bjarne Kvinge <RKvinge@novell.com>
+
+ * DataGridViewColumnCollectionTest.cs: Added AddFullColumnSelect.
+
2007-08-08 Rolf Bjarne Kvinge <RKvinge@novell.com>
* ContainerControlTest.cs, ControlTest.cs, DefaultLayoutTest.cs,
[TestFixture]\r
public class DataGridViewColumnCollectionTest \r
{\r
+ [Test]\r
+ [ExpectedException (typeof (InvalidOperationException), "Column's SortMode cannot be set to Automatic while the DataGridView control's SelectionMode is set to FullColumnSelect.")]\r
+ public void AddFullColumnSelect ()\r
+ {\r
+ DataGridView dgv = new DataGridView ();\r
+ dgv.SelectionMode = DataGridViewSelectionMode.FullColumnSelect;\r
+ dgv.Columns.Add ("A", "A");\r
+ }\r
+ \r
[Test]\r
public void Add ()\r
{\r