Click here to Skip to main content
15,913,587 members
Home / Discussions / WPF
   

WPF

 
QuestionHow to create a custom display of items in WPF? Pin
darthBug22-Jan-10 8:03
darthBug22-Jan-10 8:03 
AnswerRe: How to create a custom display of items in WPF? Pin
hb5213421422-Jan-10 8:38
hb5213421422-Jan-10 8:38 
QuestionNeed to dynamically size width of ListBox.ItemsPanel Pin
fjparisIII21-Jan-10 17:48
fjparisIII21-Jan-10 17:48 
AnswerRe: Need to dynamically size width of ListBox.ItemsPanel Pin
Gideon Engelberth22-Jan-10 5:33
Gideon Engelberth22-Jan-10 5:33 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
fjparisIII22-Jan-10 6:52
fjparisIII22-Jan-10 6:52 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
hb5213421422-Jan-10 7:33
hb5213421422-Jan-10 7:33 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
fjparisIII22-Jan-10 8:43
fjparisIII22-Jan-10 8:43 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
hb5213421422-Jan-10 9:45
hb5213421422-Jan-10 9:45 
Dropping your code directly into a window with a few changes:

    <ListBox    Name="listBox"
          BorderThickness="0"
->        HorizontalAlignment="Stretch"
->        HorizontalContentAlignment="Stretch"
->        ScrollViewer.HorizontalScrollBarVisibility="Disabled"
          SelectionMode="Extended">
      <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
          <WrapPanel Name="wrapPanel"
                        MinHeight="17"
->                      HorizontalAlignment="Stretch"
                        Background="Blue"
                        IsItemsHost="True"
                        Orientation="Horizontal"
                        ></WrapPanel>
        </ItemsPanelTemplate>
      </ListBox.ItemsPanel>
    </ListBox>


Does what I think you're trying to achieve.

If the list box is inside a grid, a grid will default to resize with its container, but the columns may not? In the grid set the column width to '*':
<Grid.COlumndefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>

If you have more than one column, do the rest have their widths set to 'auto'?
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
fjparisIII22-Jan-10 12:32
fjparisIII22-Jan-10 12:32 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
hb5213421422-Jan-10 13:55
hb5213421422-Jan-10 13:55 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
fjparisIII22-Jan-10 15:31
fjparisIII22-Jan-10 15:31 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
Kasim_Husaini20-Oct-10 20:02
Kasim_Husaini20-Oct-10 20:02 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
Gideon Engelberth22-Jan-10 12:46
Gideon Engelberth22-Jan-10 12:46 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel SOLVED! Pin
fjparisIII22-Jan-10 15:21
fjparisIII22-Jan-10 15:21 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel SOLVED! Pin
Gideon Engelberth22-Jan-10 19:14
Gideon Engelberth22-Jan-10 19:14 
QuestionPage loaded...but debug symbols not loaded? Need help ASAP please! Pin
Michael Eber21-Jan-10 9:03
Michael Eber21-Jan-10 9:03 
AnswerRe: Page loaded...but debug symbols not loaded? Need help ASAP please! Pin
Mark Salsbery21-Jan-10 13:52
Mark Salsbery21-Jan-10 13:52 
GeneralRe: Page loaded...but debug symbols not loaded? Need help ASAP please! Pin
Michael Eber21-Jan-10 19:05
Michael Eber21-Jan-10 19:05 
AnswerRe: Page loaded...but debug symbols not loaded? Need help ASAP please! Pin
Abhinav S21-Jan-10 19:24
Abhinav S21-Jan-10 19:24 
GeneralRe: Page loaded...but debug symbols not loaded? Need help ASAP please! Pin
Michael Eber22-Jan-10 12:43
Michael Eber22-Jan-10 12:43 
GeneralRe: Page loaded...but debug symbols not loaded? Need help ASAP please! Pin
Abhinav S22-Jan-10 20:52
Abhinav S22-Jan-10 20:52 
Questionisolated storage Pin
Tauseef A20-Jan-10 21:19
Tauseef A20-Jan-10 21:19 
AnswerRe: isolated storage Pin
Mark Salsbery21-Jan-10 5:37
Mark Salsbery21-Jan-10 5:37 
AnswerRe: isolated storage Pin
Abhinav S21-Jan-10 17:30
Abhinav S21-Jan-10 17:30 
AnswerRe: isolated storage Pin
fred_5-Feb-10 10:18
fred_5-Feb-10 10:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.