Skip to content

TreeListView in Avalonia #5585

Answered by Gramli
ShrutiJaiswal1494 asked this question in Q&A
Discussion options

You must be logged in to vote

Hope I understand, you can set Column.Width, then the second, third .. columns will be aligned.

      <TreeView Items="{Binding Items}">
        <TreeView.DataTemplates>
          <TreeDataTemplate DataType="models:Item" ItemsSource="{Binding SubItems}">
            <Grid>
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="200"/>
                <ColumnDefinition Width="200"/>
              </Grid.ColumnDefinitions>
              <TextBlock Text="{Binding Name}" Grid.Column="0"/>
              <TextBlock Text="{Binding Type}" Grid.Column="1"/>
              <TextBlock Text="{Binding Data}" Grid.Column="2"/>
       …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@ShrutiJaiswal1494
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by ShrutiJaiswal1494
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants