Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataBinding question
Message
From
09/12/2005 13:09:43
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01076567
Message ID:
01076682
Views:
12
Chad,

>Might it not just need to be scoped public? Isn't it protected by default?<

Yes and no. You're right that it's not scoped public, but that's not the problem. DataBinding requires an actual property, not just a public variable. It needs to have the get/set. Plus, in messing with it, I also see that the property itself can't be static. In fact, it doesn't work at all without an instantiated class (I got compiler errors), so I'm not sure how Pete got his example to even compile.

~~Bonnie



>
>HTH,
>Chad
>
>>Try making it a property (with get/set), then it might work (I haven't tried it though).
>>
>>~~Bonnie
>>
>>
>>>Hello All, is it possible to bind a textbox's "Text" property to a field of a static class ? ( I hope I worded that correctly ? ) this is what I've tried but it fails at runtime with the error: "cannot create a child list...", any help much appreciated
>>>
>>>e.g.
>>>
>>>
>>>class myclass
>>>{
>>>    static string mystring = "Pete";
>>>}
>>>
>>>
>>>// Then from a form somewhere
>>>
>>>this.txtMytextbox.DataBindings.Add("Text",myclass,"mystring");
>>>
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform