Fill Grid width inside a listbox

后端 未结 1 1593
悲&欢浪女
悲&欢浪女 2020-12-06 10:11

I have a grid as the datatemplate for items in a listbox and it\'s not filling the whole width of the control. I have tried the suggestions in the other questions but they a

1条回答
  •  猫巷女王i
    2020-12-06 10:41

    You need to make the ListBoxItems stretch their content, either by changing the respective property on the ListBox:

    
    

    ...or by setting it on the items via the ItemContainerStyle:

    
        
    
    

    By default both will work as the ListBoxItem default style binds the HorizontalContentAlignment property to the owning ListBox's property.

    0 讨论(0)
提交回复
热议问题