Click here to Skip to main content
11,480,031 members (66,020 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Hi All,

Do you know how to fix this?

Error:
Unable to cast object of type 'System.Windows.Forms.DataGridViewTextBoxCell' to type 'System.Windows.Forms.Control'.


Thank you!
Posted 17-Jan-13 21:01pm
Comments
codejet at 18-Jan-13 2:11am
   
How about giving us more info on what you are trying to do? Throw me a bone , I'm the boss, need the info .
Sergey Alexandrovich Kryukov at 18-Jan-13 2:20am
   
Of course you cannot cast it, because cell is not Control. Who told you it is?
You should not "fix" it; you should not do it at all.
—SA
Sergey Alexandrovich Kryukov at 18-Jan-13 2:26am
   
And please stop posting your fake answers ("I got it", and the like). I removed all of them but one.

"Add your solution here" is reserved for the cases when you at least try to provide some help, in response to some question. Doing so will bring your nothing but down-voted and abuse reports. You don't want it, so I only helped you by removing them. Several more heavy abusers already lost their membership account because of their abuse.

Thank you for understanding.
—SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Look at the inheritance table for this class[^]. The DataGridViewTextBoxCell does not inherit from Control so you cannot cast it so.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 235
1 Sergey Alexandrovich Kryukov 215
2 Richard MacCutchan 100
3 F-ES Sitecore 75
4 DamithSL 65
0 Sergey Alexandrovich Kryukov 7,890
1 OriginalGriff 7,556
2 Sascha Lefèvre 3,064
3 Maciej Los 2,491
4 Richard Deeming 2,335


Advertise | Privacy | Mobile
Web02 | 2.8.150520.1 | Last Updated 18 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100