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

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

3 Answers 274 Views
Expander
This is a migrated thread and some comments may be shown as answers.
Pinho
Top achievements
Rank 1
Pinho asked on 28 May 2009, 04:59 PM
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

3 Answers, 1 is accepted

Sort by
0
Nedyalko Nikolov
Telerik team
answered on 01 Jun 2009, 08:24 AM
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.
0
Leandro
Top achievements
Rank 1
answered on 28 Jul 2009, 11:14 AM
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.
0
Ivan
Telerik team
answered on 03 Aug 2009, 02:21 PM
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.
Tags
Expander
Asked by
Pinho
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Leandro
Top achievements
Rank 1
Ivan
Telerik team
Share this question
or