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
  • 35319
    posted

    Hell Dierk,

     

    I have been looking into your first issue and I could not be able to reproduce it on my side. I am attaching a sample application(XamDataGridExportToExcel.zip) that I have used for my tests.

     

    Could you please modify it in order to meet exactly your scenario ?

     

    Looking forward to hearing from you.

    XamDataGridExportToExcel.zip
Reply Children