Hi, I'm trying to make a grid that represent bookings over a month(excel style).
For this I have used the WPF Datagrid and defined my column in C# code:
for (int i = 0; i < noOfDaysInMonth; i++)
{
DataGridTextColumn tmpColumn = new DataGridTextColumn
{
Header = (i + 1).ToString(),
Binding = new Binding("CellStrings[" + i + "]"),
};
overviewBookingsDataGrid.Columns.Add(tmpColumn);
Now this works fine. The problem I got is that I don´t know how to style the background color of each cell depending on if the slot is fully booked, partially booked or empty. All examples I have found has been in XAML and defines it togheter with the column and I don't know that translates to C#.