Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with AddRange and DataGridView
Message
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01378089
Message ID:
01380004
Views:
29
>Thanks Viv - I still don't understand completely - maybe one day ?

Probably because I'm lousy at explaining things.

The AddRange method accepts an array of type DataGridViewColumn (or any class derived therefrom)
You are creating an array of type PJKBaseDataGridViewColum - so far so good since it IS derived from DataGridViewColumn.
But the first item in the array (Column1) is of type PJBaseDataGridViewTextBoxColumn.
This is derived from the Windows.DataGridViewTextBoxColumn NOT PJKBaseDataGridViewColum.
Therefore it can't be added to the array.
If you derive PJBaseDataGridViewTextBoxColumn from PJKBaseDataGridViewColum instead all should be well.
Alternatively if you create an array of type Windows.DataGridViewColumn that should also work.

Dang, I don't think that's any clearer either :-{

How's the snow with you?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform