RadGridView inside Expander with ColumnsWidthMode="Fill" doesn't fill the full width

4 posts, 0 answers
  1. Pinho
    Pinho avatar
    42 posts
    Member since:
    Mar 2009

    Posted 28 May 2009 Link to this post

    Hi,

     I'm using a RadGridView inside an Expander and I set the ColumnsWidthMode property to "Fill", but although the grid itself fills the full width (I see this by setting the background color to red) the columns don't fill the space available:

            <telerikNavigation:RadPanelBar Grid.ColumnSpan="3" Grid.Row="1" x:Name="radPanelBarResultsAndFiltersPanel" ExpandMode="Multiple" Visibility="Collapsed" > 
                 <telerikNavigation:RadPanelBarItem x:Name="rPanelBarItemFilters" Visibility="Collapsed" Header="Filters"
                    <Grid MaxHeight="200" ShowGridLines="True"
                        <Grid.ColumnDefinitions> 
                            <ColumnDefinition Width="Auto"/> 
                            <ColumnDefinition Width="*"/> 
                        </Grid.ColumnDefinitions> 
                        <l:Tree MinWidth="150" MaxWidth="300" Grid.Column="0" Grid.Row="0" IsSingleExpandPath="True" Name="treeEntityTypes"/> 
     
                        <telerikGridView:RadGridView Grid.Column="1" Grid.Row="0" x:Name="dataFilters" 
                                         RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False" 
                                         CanUserReorderColumns="False" ColumnsWidthMode="Fill" 
                                         telerikDragDrop:RadDragAndDropManager.AllowDrop="True" 
                                         ShowGroupPanel="False" CanUserSortColumns="False" Background="Blue"
    <telerikGridView:RadGridView.Columns> 
                                <telerikGridView:GridViewDataColumn CellTemplate="{StaticResource templateDeleteButton}" IsFilterable="False"/> 
                                <telerikGridView:GridViewComboBoxColumn UniqueName="AndOr" HeaderText="And/Or" 
                                                            DataMemberBinding="{Binding AndOr,Mode=TwoWay}" 
                                                            IsFilterable="False"/> 
                                <telerikGridView:GridViewDataColumn  UniqueName="Field" HeaderText="Field" IsReadOnly="True" 
                                                         DataMemberBinding="{Binding Name}" IsFilterable="False"/> 
                                <telerikGridView:GridViewComboBoxColumn UniqueName="Operator" HeaderText="Operator" 
                                                            DataMemberBinding="{Binding Operator,Mode=TwoWay}" 
                                                            IsFilterable="False"/> 
                                <telerikGridView:GridViewDataColumn UniqueName="Value" HeaderText="Value" 
                                                        DataMemberBinding="{Binding Value,Mode=TwoWay}"   
                                                        IsFilterable="False"/> 
                            </telerikGridView:RadGridView.Columns> 
                        </telerikGridView:RadGridView> 
                    </Grid>                    
     </telerikNavigation:RadPanelBarItem> 
            </telerikNavigation:RadPanelBar>

    Could you help me?

    Thanks,

    L. Pinho
  2. Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 01 Jun 2009 Link to this post

    Hi Luis,

    I've managed to reproduce your problem. It seems that you've hit a bug in the RadGridView control, so I've updated your Telerik points accordingly.

    Problem with your scenario is that RadGridView.ColumnsWidthMode = Fill, does not work when RadGridView has an indeterminate width (infinity). That's why when the width is indeterminate RadGridView changes all "star" columns to "auto" columns. This sounds good but when there is no data source RadGridView does not recalculate header row which is the actual bug.

    As a workaround I can suggest you to give some valid Width of the parent RadExpander, or change the RadGridView.ColumnsWidthMode.

    Sorry for the inconvenience caused.

    P.S. We will do our best to fix this for the next official release.

    Sincerely yours,
    Nedyalko Nikolov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
  4. Leandro
    Leandro avatar
    2 posts
    Member since:
    Jun 2009

    Posted 28 Jul 2009 Link to this post

    Not only the radgrid has this problem, any component that you put inside the expander control does not get the full width. I try with a default datagrid and other controls.
  5. Ivan
    Admin
    Ivan avatar
    519 posts

    Posted 03 Aug 2009 Link to this post

    Hi Leandro,

    Thank you for your interest in the RadExpander control.

    As we found another post (by you) about the expander, the wrap panel and the data grid we prepared (and attached to this post) a small example in order to demonstrate their usage. In general there are two expanders with data-grid as content. The only difference is the RadWrapPanel which wraps the data-grid inside the second expander - as a result the second data-grid appears shrunken.

    Please give it a try and let me know if there are more questions.

    Sincerely yours,
    Ivan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top