Skip to main content

Microsoft Silverlight

Having a problem in 2 Beta 2 adding a user control dynamicallyRSS Feed

(0)

Futzy
Futzy

Member

Member

0 points

2 Posts

Having a problem in 2 Beta 2 adding a user control dynamically

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?

Futzy
Futzy

Member

Member

0 points

2 Posts

Re: Having a problem in 2 Beta 2 adding a user control dynamically

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 shirpuram
rajesh s...

Contributor

Contributor

2314 points

505 Posts

Re: Re: Having a problem in 2 Beta 2 adding a user control dynamically

There is no such bug in stackpanel....Can you post your demo code here?

Thanks
Rajesh Shirpuram

(If this has answered your question, please click on "mark as answer" on this post. Thank you!)
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities