0

I feel attaching elements to Grid after defining row and columns is less intuitive. I understand it gives crisp idea of grids layout when its a complex layout. But when the layout is simple, I feel inline definition like Html's Table is more intuitive.

  1. Does Wpf grid provides inline child element declaration?
  2. Why this type of declaration is favored/default behavior?

2 Answers 2

2

You can get slightly closer to not defining the rows and columns by using a UniformGrid and then specifying either a number of rows or number of colums. This will then cause child elements to be automatically divided into the specified layout. E.g

<UniformGrid Columns="3">
    <-- 6 children -->
</UniformGrid>

will split the children into a 3x2 evenly sized grid.

If you want to have things like autosizing columns etc then you probably need to look at one of the many DataGrid components out there

Sign up to request clarification or add additional context in comments.

Comments

0
  1. No
  2. This question is best addressed to the WPF designers. I guess you can get hold of some of them at http://social.msdn.microsoft.com

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.