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

fflorent coldsun01 at gmail.com
Wed May 20 04:11:14 EDT 2009


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 : 

Excuse me if my English is not correct, do not hesitate to ask precisions
View this message in context: http://www.nabble.com/bug-with-DataGridViewBand.DefaultHeaderCellType---tp23630949p23630949.html
Sent from the Mono - WinForms mailing list archive at Nabble.com.

More information about the Mono-winforms-list mailing list