Note that there are some explanatory texts on larger screens.

plurals
  1. POGrid SharedSizeGroup - columns are bouncing, resizing in infinite loop
    primarykey
    data
    text
    <p>I need table with both horizontal and vertical header (simple PivotGrid). I have found some similar (or almost same) problems here, but no one give the solution. In XAML I have defined this structure:</p> <pre><code>&lt;Grid x:Name="grdMain" Background="White" Grid.IsSharedSizeScope="True"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="Auto"/&gt; &lt;ColumnDefinition Width="Auto"/&gt; &lt;ColumnDefinition Width="Auto"/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="Auto"/&gt; &lt;RowDefinition Height="Auto"/&gt; &lt;RowDefinition Height="Auto"/&gt; &lt;/Grid.RowDefinitions&gt; &lt;Grid Grid.Row="0" Grid.Column="1" x:Name="grdHorizontalHeader"&gt; &lt;!-- place for column definitions and header labels defined in code --&gt; &lt;/Grid&gt; &lt;Grid Grid.Row="1" Grid.Column="0" x:Name="grdVerticalHeader"&gt; &lt;!-- place for column definitions and header labels defined in code --&gt; &lt;/Grid&gt; &lt;Grid Grid.Row="1" Grid.Column="1" x:Name="grdContent"&gt; &lt;!-- place for column definitions and header labels defined in code --&gt; &lt;/Grid&gt; &lt;/Grid&gt; </code></pre> <p>So both header consist of grid with some ColumnDefinitions (resp. RowDefinitions) and I need to size Header-ColumnDefinitions according to Content-ColumnDefinitions. I do it in code:</p> <pre><code>foreach (var row in myColumnSource) { // Content columns definitions var cD = new ColumnDefinition(); cD.Width = GridLength.Auto; cD.SharedSizeGroup = "ColumnSharedSizeGroup" + row.Value; this.grdContent.ColumnDefinitions.Add(cD); // Header columns definitions var cD2 = new ColumnDefinition(); cD2.Width = GridLength.Auto; cD2.SharedSizeGroup = "ColumnSharedSizeGroup" + row.Value; this.grdHorizontalHeader.ColumnDefinitions.Add(cD2); ... </code></pre> <p>So Header-Column should share it's Width with Content-Column. But when I run the program, the columns are bouncing and resizing in infinite loop. Row's height sharing work fine. Where could be the problem?</p> <p><strong>EDIT</strong> only columns in header (grdHorizontalHeader) are resizing. Columns in grdContent have correct and stable width.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload