Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2395
Actual Column Width When Width="*"
posted

I'm running into issues with column widths in two different areas using the 11.1 release. I have a grid where all columns have Width="*" in their XAML.

First, when we try to export the grid to Excel, all columns are very small. See below:

I also have a customized GroupByRecordPresenter. A grid column is bound to the width of the first xamdatagrid column. Here's the xaml:

 <Grid.ColumnDefinitions>
 <ColumnDefinition Width="{Binding ElementName=grdOrder, Path=DefaultFieldLayout.Fields[0].CellWidthResolved}"/>
 <ColumnDefinition Width="Auto"/>
 <ColumnDefinition Width="Auto"/>
 <ColumnDefinition Width="Auto"/>
 <ColumnDefinition Width="Auto"/>
 <ColumnDefinition Width="Auto"/>
 </Grid.ColumnDefinitions>
 <TextBlock Background="White" Foreground="Black" Text="{Binding Path=Record.ChildRecords, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ATMTextConverter}, ConverterParameter=Instrument}" Margin="0,0,1,0" Grid.Column="0"/>

The result of this binding is below:

You can see some text on the left cut off.

For both the Excel export and the grouping customization, manually changing the column width fixes the layout problems. For example:

In both cases, I just want the column widths to just work when the xamdatagrid column width is set to star. I have been unable to get a usable value from CellWidthResolved or LabelWidthResolved properties.

Parents Reply Children