Answer the question
In order to leave comments, you need to log in
WPF, How to generate a spreadsheet like Excel?
Good afternoon!
I'm just getting started with WPF. There was a task to create an editable plate in which the columns are dates, and the rows are People. In the cells, the user must enter how many hours the person worked that day.
Accordingly, the question is how to generate such a table?
Answer the question
In order to leave comments, you need to log in
It could be something like this. You start a class with a main object, something like this:
public class Worker
{
public string FIO {get;set;}
public SpanTime WorkTime {get;set;}
}
<ListBox x:Name="lst">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBox Text="{Binding FIO}" />
<TextBox Text="{Binding WorkTime}" Grid.Column="1"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question