Does the StackGrid support the remainder operator (star)?

Nov 17, 2011 at 11:45 AM
Edited Nov 17, 2011 at 11:46 AM

I wanted to use the StackGrid for my application. However it is not working as I expected. When using a Grid without defining an width or height it uses the full size of the grid to fit the controls. However the StackGrid only appears to support the fixed size or autosize methods and the remainder "*" does not appear to be supported. Is this a limitation of the StackGrid?

Use the xaml below to reproduce the scenario:

<StackPanel>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="auto"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <Label Content="1"/>
        <Label Grid.Column="1" Content="2"/>
        <Label Grid.Row="1" Content="3"/>
        <Label Grid.Row="1" Grid.Column="1" Content="4"/>
    </Grid>

    <catel:StackGrid>
        <catel:StackGrid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="auto"/>
        </catel:StackGrid.ColumnDefinitions>
        <catel:StackGrid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
        </catel:StackGrid.RowDefinitions>
        
        <Label Content="1"/>
        <Label Content="2"/>
        <Label Content="3"/>
        <Label Content="4"/>
    </catel:StackGrid>
</StackPanel>
 
Coordinator
Nov 17, 2011 at 6:33 PM

Thank you for the report. You are right, this is an issue and we just fixed it. You can download the latest source which contains the fix.

Coordinator
Nov 18, 2011 at 11:08 AM

For your convenience, I have updated the beta files:

http://dl.dropbox.com/u/8455721/Catel%20beta.zip

Nov 18, 2011 at 11:11 AM

I had already downloaded the source and confirmed that the problem has been solved. Thanks for the quick fix though.