Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with AddRange and DataGridView
Message
 
To
All
General information
Forum:
ASP.NET
Category:
Forms
Title:
Problems with AddRange and DataGridView
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01378089
Message ID:
01378089
Views:
70
Hi All, I recently subclassed some of the commonly used DataGridView (dgv from here on ) controls and duly modifed my app code to utilise them, all went as expected until I got to adding the columns as an array of DataGridViewColumns.

The form designer generated code looked like this
this.dgvBlocks.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { column1,column2 })
So, I duly changed System.Windows.Forms.DataGridViewColumn[] to my subclass , I then received this compiler error
cannot implicitly convert type MyDataGridViewTextBoxColumn to MyDataGridViewColumn 
But if I use the designer code it works ! Any ideas ?
Regards,
Peter J. Kane



Pete
Next
Reply
Map
View

Click here to load this message in the networking platform