[Mono-winforms-list] bug with DataGridViewBand.DefaultHeaderCellType ?

Jonathan Pobst monkey at jpobst.com
Thu May 21 14:25:13 EDT 2009


That definitely looks like a bug, can you please file it in our bugzilla 
so it doesn't get lost?

http://www.mono-project.com/Bugs

Thanks!
Jonathan

fflorent wrote:
> Hello,
> 
> I would like to know if this piece of code taken from DataGridViewBand.cs is
> normal or contains a bug : 
>                 [Browsable (false)]
> 		public Type DefaultHeaderCellType {
> 			get { return defaultHeaderCellType; }
> 			set {
> 				if (value.IsSubclassOf(typeof(DataGridViewHeaderCell))) {
> 					throw new ArgumentException("Type is not DataGridViewHeaderCell or a
> derived type.");
> 				}
> 				defaultHeaderCellType = value;
> 			}
> 		}
> 
> Indeed, I wonder if the condition shouldn't be like this : 
> if (! value.IsSubclassOf(typeof(DataGridViewHeaderCell))) {
> 
> I tested this piece of code under the Microsoft's .NET runtime  and Mono : 
> test.DefaultHeaderCellType = GetType(DataGridViewColumnHeaderCell)
> No problème under Microsoft's .NET runtime, whereas Mono throws the
> exception of the following line.
> 
> And this piece of code : 
> test.DefaultHeaderCellType = GetType(Integer) 'Integer or an other type
> should be the same
> Is accepted by Mono and MS's .NET runtime throws an exception
> 
> Thank you in advance
> 
> Some links if it can help you : 
> http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewband.defaultheadercelltype.aspx
> http://www.koders.com/csharp/fid76C842C395A5B4F282C9F85D70A2BFD4FE05201A.aspx?s=datagridview#L31
> 
> Excuse me if my English is not correct, do not hesitate to ask precisions



More information about the Mono-winforms-list mailing list