views:

790

answers:

2

Hi,

How to resize listview when main window is resized?

Sorry for editing.

Want to set the minwidth for gridviewcolumn. So the listview column is set to the min width when page is resized. Is it possible?

Thanks SD

                    </GridViewColumn>
                    <GridViewColumn     Header="Item">


                    </GridViewColumn>
                    <GridViewColumn  Header="Price">

                    </GridViewColumn>
                    <GridViewColumn   Header="Total Price1">


                    </GridViewColumn>
                </GridView>
            </ListView.View>


        </ListView>
    </Grid>

A: 

Put it in a container control that resizes its content.

<Grid>
  <ListView ... />
</Grid>

or

<DockPanel>
  <ListView ... />
</DockPanel>

or others...

In WPF, containers control sizing and layout.

Will
From the code snippet, it already looks as though it is inside a Grid.
Drew Noakes
Yes, amazing that edit feature. You can come back and add stuff like code samples and make people look like idiots.
Will
A: 

have you set the HorizontalContentAlignment of your listbox?

Rob Fonseca-Ensor
Yes i tried setting the HorizontalContentAlignment. It didn't worked.My listview has a expander. Expander are displayed as rows in listview. Expander content has textbox to allow use to enter the data. The textbox is not getting resized on window resize
sDev