Setting the width of the list

I have a GroupBox inside a DockPanel and it contains two lists. There are 2 buttons. Each button opens one view of the list, and the other will collapse. But the listview will not adjust the width to fit within the group package.

How can I create a list in a group box?

0


a source to share


2 answers


Remove the dock before adding the control.



ie On the button, click clear panel using dockPanel.Children.Clear (); and add a new item using dockPanel.Children.Add (control);

0


a source


Make the width of the ListView as "Auto" and HorizontalAligment = "Strech" ... hope this solves your problem.



0


a source







All Articles