2008-04-21 Jonathan Pobst <monkey@jpobst.com>
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / DataGridViewComboBoxCell.cs
index efb01eadee600b59a6934167cf0ce0900c73536b..f4b30d637e1f859f819411361283cf570404f02d 100644 (file)
@@ -223,8 +223,13 @@ namespace System.Windows.Forms {
                        throw new NotImplementedException();
                }
 
-               protected override Rectangle GetErrorIconBounds (Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex) {
-                       throw new NotImplementedException();
+               protected override Rectangle GetErrorIconBounds (Graphics graphics, DataGridViewCellStyle cellStyle, int rowIndex)
+               {
+                       if (DataGridView == null || string.IsNullOrEmpty (ErrorText))
+                               return Rectangle.Empty;
+
+                       Size error_icon = new Size (12, 11);
+                       return new Rectangle (new Point (Size.Width - error_icon.Width - 23, (Size.Height - error_icon.Height) / 2), error_icon);
                }
 
                protected override object GetFormattedValue (object value, int rowIndex, ref DataGridViewCellStyle cellStyle, TypeConverter valueTypeConverter, TypeConverter formattedValueTypeConverter, DataGridViewDataErrorContexts context) {
@@ -362,13 +367,14 @@ namespace System.Windows.Forms {
                                return list.Contains(value);
                        }
 
-                       void ICollection.CopyTo (Array destination, int arrayIndex)
+                       void ICollection.CopyTo (Array destination, int index)
                        {
-                               CopyTo ((object[])destination, arrayIndex);
+                               CopyTo ((object[]) destination, index);
                        }
 
-                       public void CopyTo (object[] destination, int arrayIndex) {
-                               list.CopyTo(destination, arrayIndex);
+                       public void CopyTo (object[] destination, int arrayIndex)
+                       {
+                               list.CopyTo (destination, arrayIndex);
                        }
 
                        public IEnumerator GetEnumerator () {
@@ -392,9 +398,9 @@ namespace System.Windows.Forms {
                        }
 
 
-                       int IList.Add (object value)
+                       int IList.Add (object item)
                        {
-                               return Add (value);
+                               return Add (item);
                        }
 
                }