Increase columns width in Silverlight DataGrid to fill whole DG width

Posted by Henrik P. Hessel on Stack Overflow See other posts from Stack Overflow or by Henrik P. Hessel
Published on 2009-05-21T20:34:59Z Indexed on 2010/04/28 4:33 UTC
Read the original article Hit count: 563

Filed under:
|
|
|

Hello,

I have a DataGrid Control which is bound to a SQL Table.

The XAML Code is:

<data:DataGrid x:Name="dg_sql_data" 
                       Grid.Row="1" 
                       Visibility="Collapsed" 
                       Height="auto" 
                       Margin="0,5,5,5"
                       AutoGenerateColumns="false"
                       AlternatingRowBackground="Aqua"
                       Opacity="80"
                       >
    <data:DataGrid.Columns>
        <data:DataGridTextColumn Header="Latitude" Binding="{Binding lat}" />
        <data:DataGridTextColumn Header="Longitude" Binding="{Binding long}" />
        <data:DataGridTextColumn Header="Time" Binding="{Binding time}" />
    </data:DataGrid.Columns>
</data:DataGrid>

Is it possible increase the single columns sizes to fill out the complete width of the datagrid?

thx!, rAyt

Edit: Columns with "*" as width are coming with the Silverlight SDK 4.

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about datagrid