views:

27

answers:

0

How can set "AllowUserToResizeRows" property in Header listview wpf?

it was in Windows.Forms thus :" dataGridView.AllowUserToResizeRows = false "

My xaml code is :

<ListView Margin="2.5,0,0,32" Name="listView1" ItemContainerStyle="{StaticResource myItemStyle}" SelectionMode="Single" HorizontalContentAlignment="Center" VerticalAlignment="Bottom" SelectionChanged="listView1_SelectionChanged" Height="326" Background="PaleGoldenrod">
            <ListView.View>
                <GridView AllowsColumnReorder="False" >
                    <GridViewColumn Width="150" Header="Value" >
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid >
                                    <TextBlock Text="{Binding Path=Value}" TextAlignment="Center" Width="150" Style="{StaticResource GridBlockStyle}"/>
                                    <TextBox Name="EditBox" Text="{Binding Path=Value}" TextAlignment="Center" Width="75" Style="{StaticResource GridEditStyle}" LostKeyboardFocus="TextBox_LostKeyboardFocus" GotFocus="EditBox_GotFocus" KeyDown="EditBox_KeyDown" />
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                    <GridViewColumn Width="260" Header="subject" >
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <Grid>
                                    <TextBlock Text="{Binding Path=Name}" TextAlignment="Center" Width="260" Style="{StaticResource GridBlockStyle}"/>
                                    <TextBlock Text="{Binding Path=Name}" TextAlignment="Center" Width="260" Style="{StaticResource GridEditStyle}" />
                                </Grid>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>