简体   繁体   中英

How to resize RadGridView width as column is being stretched?

My XAML is like this

<telerik:RadGridView x:Name="gvModel" Margin="5,0,5,0" HorizontalAlignment="Stretch">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" MinWidth="270" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding ValuationTypeText}" Header="Period Type" TextWrapping="NoWrap" TextTrimming="WordEllipsis" MinWidth="75"/>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding ValuationDate, StringFormat='yyyy/MM/dd'}" Header="Valuation Date" MinWidth="75"/>
                        </telerik:RadGridView.Columns>
</telerik:RadGridView>

I put the RadGridView above in a grid and when the grid width was stretched (assume using gridsplitter) the RadGridView's width should be stretched too. But it wasn't. It was always at the grid column center. Thanks for your helps.

put initial widths of each column and add * to those columns which should be resizable

eg

Width="200*"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM