Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Having a problem in 2 Beta 2 adding a user control dynamically
2 replies. Latest Post by rajesh shirpuram on July 28, 2008.
(0)
Futzy
Member
0 points
2 Posts
07-27-2008 6:10 PM |
I am working on a silverlight app in c# using 2 Beta 2. My main page control has a simple grid, 2 columns, 2 rows. Inside of that grid are 3 stack panels. In the first two stack panels, we dynamically add various controls (textblock, radiobutton, button) and they work fine. In the third one, we are now trying to add a user control we made in the same way, but it does not show up. However, if we also add a textblock, we can see the textblock, and its positioning indicates that the user control is there, it's just not visible. Furthermore, if we add the user control staticly in the XAML, it shows up fine as expected. The user control is fairly simple, just a grid with several text blocks. Is this possibly a bug, or am I missing something simple?
07-27-2008 6:35 PM |
I have at least a partial answer. We tried adding the user control to the second stack panel that was working, and it worked. The only difference between the stack panels was their orientation, the one that works is vertical, the one that doesn't is horizontal. So we tried changing the one that doesn't work to vertical, and it suddenly started working. So this leads me to two possible conclusions:
1. Is there a bug with StackPanels set to Horizontal?
2. Is there a maximum width for a silverlight control? Maybe we got so wide it messed up the display?
rajesh s...
Contributor
2314 points
505 Posts
07-28-2008 2:41 AM |
There is no such bug in stackpanel....Can you post your demo code here?