Y
Y
youngpr2020-09-27 14:43:48
WPF
youngpr, 2020-09-27 14:43:48

Is it possible to set a header for this table in wpf?

To have such headers as full name, position and so on..
Here is the code with Visual Studio 2019

<Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="50" />
        </Grid.RowDefinitions>
        <ListBox SelectionMode="Multiple" x:Name="phonesList" ItemsSource="{Binding}">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <TextBlock Text="{Binding Name}" FontSize="16" />
                        <TextBlock Text="{Binding Position}" FontSize="12" />
                        <TextBlock Text="{Binding PhoneNumber}" FontSize="13" />
                        <TextBlock Text="{Binding Email}" FontSize="16" />
                        <TextBlock Text="{Binding Organisation}" FontSize="16" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
            <Button Content="Добавить" Margin="10" Click="Add_Click" />
            <Button Content="Изменить" Margin="10" Click="Edit_Click"  />
            <Button Content="Удалить" Margin="10" Click="Delete_Click"  />
        </StackPanel>
</Grid>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2020-09-28
@youngpr

Use DataGrid instead of ListBox

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question