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
250
XamGrid GroupColumn Sizing
posted

Hi,

In my grid I've defined three XamGrid GroupColumns, each containing an arbitrary set of TextColumns.  I want GroupColumn 1 to have 'star' width, GroupColumn 2 to have a fixed pixel width, and GroupColumn 3 to have 'star' width also.  These three GroupColumns must always span the full width of the host window.  Within each GroupColumn I want the text columns to autofit to fill the available space.   Here's my attempt to achieve this:

<ig:XamGrid ItemsSource="{Binding OptionsView}"
                    AutoGenerateColumns="False"
                    IsAlternateRowsEnabled="True">
    <ig:XamGrid.Columns>
        <ig:GroupColumn Key="Call"
                                Width="1*">
            <ig:GroupColumn.Columns>
                <ig:TextColumn Key="C_Bid"
                                       HeaderText="Bid"/>
                <ig:TextColumn Key="C_Ask"
                                       HeaderText="Ask" />
            </ig:GroupColumn.Columns>
        </ig:GroupColumn>

        <ig:GroupColumn Key="StrikeGrp"
                                HeaderText="Strike"
                                Width="150">
            <ig:GroupColumn.Columns>
                <ig:TextColumn Key="Strike"
                                       Width="150" />
            </ig:GroupColumn.Columns>
        </ig:GroupColumn>

        <ig:GroupColumn Key="Put"
                                Width="1*">
            <ig:GroupColumn.Columns>
                <ig:TextColumn Key="P_Bid"
                                       HeaderText="Bid"/>
                <ig:TextColumn Key="P_Ask"
                                       HeaderText="Ask" />
            </ig:GroupColumn.Columns>
        </ig:GroupColumn>

    </ig:XamGrid.Columns>
</ig:XamGrid>

Unfortunately, setting a GroupColumn's Width property has no discernable effect on the layout.  Can someone tell me how I can achieve the above objective?

Many thanks,
James