Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I want my TreeView to have a header, where you are able to change the width of all the elements (simular to the header of a datagrid).

(我希望TreeView有一个标头,您可以在其中更改所有元素的宽度(类似于datagrid的标头)。)

But more importantly I'm trying to add some sort of navigation, where you jump to the next element, when you press a key.

(但更重要的是,我试图添加某种导航,当您按某个键时,您会跳到下一个元素。)

Is something like that possible?

(这样有可能吗?)

<Grid>
    <Grid.Resources>
        <local:SourceToBackgroundConverter x:Key="conv" />
    </Grid.Resources>
    <DockPanel Name="spContent">
        <es:Button DockPanel.Dock="Top" Name="btSafe" Margin="0"
                   Height="25px" Width="80px" Click="BtSafe_Click"
                   Content="Speichern"/>
        <TreeView ItemsSource="{Binding Table}">
            <TreeView.ItemTemplate>
                <HierarchicalDataTemplate ItemsSource="{Binding Fields}">
                    <StackPanel Orientation="Horizontal">
                        <TextBox Width="200" Text="{Binding Name}"
                                 KeyDown="Name_KeyDown" IsReadOnly="True"/>
                        <TextBox Text="{Binding Description, UpdateSourceTrigger=PropertyChanged}" 
                                 MinWidth="250" HorizontalAlignment="Stretch" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" 
                                 AcceptsReturn="True">
                            <TextBox.Background>
                                <MultiBinding Converter="{StaticResource conv}">
                                    <Binding Path="Description" />
                                    <Binding Path="ChangedDescription" />
                                </MultiBinding>
                            </TextBox.Background>
                        </TextBox>
                        <TextBox Text="{Binding Comments, UpdateSourceTrigger=PropertyChanged}"
                                 MinWidth="250" HorizontalAlignment="Stretch" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" 
                                 AcceptsReturn="True">
                            <TextBox.Background>
                                <MultiBinding Converter="{StaticResource conv}">
                                    <Binding Path="Comments" />
                                    <Binding Path="ChangedComment" />
                                </MultiBinding>
                            </TextBox.Background>
                        </TextBox>
                    </StackPanel>
                </HierarchicalDataTemplate>
            </TreeView.ItemTemplate>
        </TreeView>
    </DockPanel>
</Grid>
  ask by Alex translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
398 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...