I have a timesheet presentation which requires two grids, one for project (ie, billable) activities and one for all other activities. Each grid has a data entry column for every day of the week, as well as a Description column. The project section also requires the 1st column in the grid to display the Project Number. The totals for each day need to be shown as a footer.
I had to punt on a few issues to get a decent looking layout, including the better practice of not specifying height and width for children in a container. I don't mind doing this for all of the data entry columns - they should all be uniform anyway. I would like the Description Column to fill whatever space they get though, so I specified a MinWidth in the Description Column for the ProjectGrid and a larger one for the DescriptionColumn in the NonProjectGrid:
<!-- NonProject Grid Columns -->
<DataGridTextColumn x:Name="descCol"
Header="Description" MinWidth="335" Binding="{Binding Description}" IsReadOnly="True"/>
<!-- Monday, Tues, etc -->
<DataGridTextColumn Width="60" CanUserResize="False" .../>
<!-- Total for week -->
<DataGridTextColumn Width="60" CanUserResize="False" .../>
//
<!-- Project Grid Columns -->
<!-- Project Number -->
<DataGridTextColumn Width="70" CanUserResize="False" .../>
<DataGridTextColumn x:Name="descCol"
Header="Description" MinWidth="265" Binding="{Binding Description}" IsReadOnly="True"/>
<!-- Monday, Tues, etc -->
<DataGridTextColumn Width="60" CanUserResize="False" .../>
<!-- Total for week -->
<DataGridTextColumn Width="60" CanUserResize="False" .../>
Each grid is in an Expander. The Expander has no size properties specified.
This sounds logical to me, but doesn't work. If I don't specify a fixed height and width for the parent window, then instead of that Description column growing, the Grid itself grows, giving the undesirable (and unexpected) look as if there were an additional empty column at the end of it.
I should add that this presentation also uses the wpf pre-release ribbon on top, since that may be contributing to that weird effect.
Does this make sense to anyone? Any ideas?
Cheers,
Berryl