How to use AddChildItemBinded in C#? |
Post Reply |
Author | ||
leojay
Groupie Joined: 07 March 2005 Status: Offline Points: 27 |
Post Options
Thanks(0)
Posted: 19 May 2008 at 12:03am |
|
I'm using c#.
I define a field named nData, and a property named Data like this:
in the Form_Load function:
but the second line of the Form_Load code snippet throws an InvalidCastException, and says "Specified cast is not valid". if i change the third parameter of the second line to "Data", I still get the same error. so, my question is, is it possible to use AddChildItemBinded in C#? If it's possible, any sample available? thanks. |
||
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
|
Hi,
Just tried with vc2002 and vc2008 - your code works.
Can you modify our sample and attach it here.
|
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
leojay
Groupie Joined: 07 March 2005 Status: Offline Points: 27 |
Post Options
Thanks(0)
|
|
you can get my project here:
http://python.leojay.googlepages.com/pgtest.zip it's strange that, in your PropertyGrid sample, my code works. but in a new project, it doesn't. i don't know why. :( |
||
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
|
Hi,
Change this:
Properties->Application-> Assembly Information:
Click Checkbox "Make assembly COM-Visible"
and instead of "nData" specify public "Data"
|
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
leojay
Groupie Joined: 07 March 2005 Status: Offline Points: 27 |
Post Options
Thanks(0)
|
|
thanks, that works.
is it possible to add some specific description in the thrown exception? "Specified cast is not valid" is really not a good hint. |
||
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
|
Hi,
its .NET description not our :)
|
||
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |