This is a migrated thread and some comments may be shown as answers.

Columns are not cannot be resized beyond grid width when at least one column has Width set to *

1 Answer 109 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 27 Sep 2012, 04:02 AM
Columns are not cannot be re-sized beyond grid width when at least one column has Width set to *. This is not the behavior that I would expect and in my opinion it makes the * option almost useless because as soon as you use it, resizing columns behaviors awkwardly where the grid always tries to maintain a static total width and steals the width from other existing columns when a column is made wider.

<Window x:Class="TelerikRadGridViewTest.MainWindow"
        Title="MainWindow"
        Height="350"
        Width="525">
    <Grid>
        <telerik:RadGridView Name="grdEstimates"
                             Margin="5,1,0,0"
                             ShowGroupPanel="False"
                             IsFilteringAllowed="False"
                             AutoGenerateColumns="False"
                             IsReadOnly="True">
            <telerik:RadGridView.Columns>
 
                <telerik:GridViewDataColumn Header="Column1"
                                            Width="*"
                                            SortMemberPath="Column1"
                                            UniqueName="Column1" />
                <telerik:GridViewDataColumn Header="Column2"
                                            Width="Auto"
                                            SortMemberPath="Column2"
                                            UniqueName="Column2" />
                <telerik:GridViewDataColumn Header="Column3"
                                            Width="Auto"
                                            SortMemberPath="Column3"
                                            UniqueName="Column3" />
                <telerik:GridViewDataColumn Header="Column4"
                                            Width="Auto"
                                            SortMemberPath="Column4"
                                            UniqueName="Column4" />
                <telerik:GridViewDataColumn Header="Column5"
                                            Width="Auto"
                                            SortMemberPath="Column5"
                                            UniqueName="Column5"
                                            DataFormatString="{}{0:C}" />
                <telerik:GridViewDataColumn Header="Column7"
                                            Width="Auto"
                                            SortMemberPath="Column7"
                                            UniqueName="Column7"
                                            DataFormatString="{}{0:C}" />
                <telerik:GridViewDataColumn Header="Column7"
                                            Width="Auto"
                                            SortMemberPath="Column7"
                                            UniqueName="Column7" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>


I would expect the behavior for Width * instead to fill the available space if there is additional available horizontal space within the RadGridView control to fill. Generally this would be equal to the situation where a horizontal scroll bar is not automatically shown because it is not needed. If there is no additional horizontal space to consume with the * columns(s) then either their MinWidth values and/or Auto behavior come into play to determine what the size of these columns should be. After initial layout is done and the user attempts to re-size a column, then any column should allow resizing to grow the column larger up until it's MaxWidth value and push any columns to extend into the clipped region causing horizontal scroll to become active if it wasn't already.

If I change the definition of Column1 so that it has a Width of Auto instead of * so effectively there are no * columns then everything works as expected. Well almost, that is except for when the total width of all columns is less than the width of the GridView control itself then I get what a lot of people describe as the "extra blank column" which I understand is just there because there are no * columns to automatically fill the space. This is where I would expect a properly behaving * column to kick in and properly consume that available space, but only in this situation.

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 27 Sep 2012, 05:30 AM
Hello,

 This feature is similar to the standard WPF DataGrid. 

Regards,
Vlad
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
GridView
Asked by
Jeff
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or