2

I would like to know - which WPF control can have grid as a child as I want to insert grid to control (dynamically)

David Hall
  • 32,624
  • 10
  • 90
  • 127
MoShe
  • 6,197
  • 17
  • 51
  • 77
  • 2
    what did you try? Can you explain better? To my knowledge one of the cool things of WPF is that you can really easily nest controls, like a treeview where in every item you put anything you want... – Davide Piras Oct 10 '11 at 09:28
  • you can nest grid into grid without problem. As above, can you explain better your needs? – michele Oct 10 '11 at 09:33
  • I have something like 15 grids and I wont to put them in on control with some kind of navigation ... something like tabs panel but instead of tabs I would like to have arrow or page number – MoShe Oct 10 '11 at 10:19
  • With a lot of imagination, i read "Which ItemsControl can have a Grid as the ItemsPanel" :) And who voted this one up? – dowhilefor Oct 10 '11 at 11:12

1 Answers1

9

Any control that inherits from ContentControl is capable of containing any other single control, and any control that inherits from Panel can contain multiple instances of any other control.

In practice, this means that a large number of controls can potentially contain your Grid. If you only want a single Grid to appear in the control, and you do not need any other specific behaviour, I would recommend using an instance of ContentControl

Steve Greatrex
  • 15,789
  • 5
  • 59
  • 73