Link to home
Start Free TrialLog in
Avatar of PoeticAudio
PoeticAudio

asked on

I don't quite understand why this code works... simple, but I just don't get it.

I don't understand why you can cast a CurrencyManager as a DataView.

int rowCount = (currManager as DataView).Count;

I don't see how that works, but it does. I know this is really simple, but looking at the class heirarchy for these objects, it just doesn't make sense to me.
Avatar of PoeticAudio
PoeticAudio

ASKER

WAIT, MADE A MISTAKE...

It's the CurrencyManager.List that casts, but I still don't get it.

int rowCount = (currManager.List as DataView).Count;
I neither understand why it works for you.

I get a compile-time error in Visual Studio 2005:
Cannot convert type 'System.Windows.Forms.CurrencyManager' to 'System.Data.DataView' via a built-in conversion
read my second post
ASKER CERTIFIED SOLUTION
Avatar of gbzhhu
gbzhhu
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ahh. Okay. Thanks man!