For WPF/Silverlight layout, is it better to use a Grid with lots of rows and columns, or tons of Stackpanels?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should use a Grid if you need things to line up horizontally and vertically. Use a StackPanel to create a row or column of things when those things don’t need to line up with anything else.
However, don’t limit yourself to those two options. In particular, have a look at the DockPanel. It’s slightly more complex than a StackPanel, but its markup isn’t as cluttered as the Grid. Here’s a good article on the DockPanel:
Using the DockPanel in Silverlight 2