Click here to Skip to main content
16,004,836 members
Home / Discussions / WPF
   

WPF

 
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 
GeneralRe: Need to dynamically size width of ListBox.ItemsPanel Pin
fjparisIII22-Jan-10 12:32
fjparisIII22-Jan-10 12:32 
Interesting that it's working for you outside of a Grid. You don't even have the ActualWidth binding in the WrapPanel. I took out my binding and added in the WrapPanel HorizontalAlignment to Stretch. It definitely needs the binding. Without that, the ListBoxItems don't even try to wrap properly.

hb52134214 wrote:
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 '*':


The Grid itself does resize with its container (another Grid, which itself is the outer element of the Window). The Grid resizing is working fine, as is the ListBox itself in the third column of its Grid container. The problem is the ListBox.ItemsPanel is not.

I need the first two columns to be hardcoded because they have to line up with columns in another grid beneath the one the UserControl is in. The third column does use *:

<Grid.ColumnDefinitions>
    <ColumnDefinition Width="100"></ColumnDefinition>
    <ColumnDefinition Width="65"></ColumnDefinition>
    <ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>

So still only a partial solution. If somehow I could get hold of the WrapPanel object, I'd be fat city, because I could just trigger on the width of the dialog. That was my original question: how do I get hold of the WrapPanel, since trying to use its Name ("wrapPanel") doesn't work, probably because it's in an ItemsPanelTemplate. The original reply suggested the ActualWidth binding, but that only half works: expanding the width of the containing window works, but not contracting it. Since I'm saving the width of the window, contracting its width and then restarting it fixes everything, but customers would roll their eyes at that work-around.
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 
QuestionListView Style ? Pin
Mohammad Dayyan19-Jan-10 7:52
Mohammad Dayyan19-Jan-10 7:52 

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.