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

Header width not updating

1 Answer 24 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Adrian Weidermann
Top achievements
Rank 1
Adrian Weidermann asked on 24 Mar 2010, 09:34 AM
I tried to place various UIElements at the Grid header and as long as i don't want them to take the whole width of the column everything is alright. If i want them to stretch for example i get some weird issues. The element is always at autosize unless i set a specified size. So my next step was to try and bind it to the width of the column itself. That didn't work either, the size is updated to the right value but the UIElement is only shown at autosize. The workaround i found was to just set the size to 1000 for example that way it always takes the whole space (up to width 1000 of course).

Or did i just miss something at my code ? ;)

                <Controls:GridViewDataColumn x:Name="IdDefinitionGroup" UniqueName="IdDefinitionGroup" Width="100" IsSortable="True" IsFilterable="True"  
                                             DataMemberBinding="{Binding IdDefinitionGroup, ValidatesOnDataErrors=True, ValidatesOnExceptions=True, UpdateSourceTrigger=PropertyChanged}"
                    <Controls:GridViewColumn.Header> 
                        <Grid Width="{Binding ElementName=IdDefinitionGoup, Path=Width, Mode=TwoWay}"
                            <TextBlock Foreground="#15428b" HorizontalAlignment="Stretch" 
                                       Text="Id" ToolTip="Test ToolTip"/> 
                        </Grid> 
                    </Controls:GridViewColumn.Header> 
                </Controls:GridViewDataColumn> 



1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan Dobrev
Telerik team
answered on 29 Mar 2010, 09:33 AM
Hi Adrian,

By default the header content is stretched, so you don't have to do anything specific in order to stretch your content. Unfortunately we have introduced a bug in our latest release which prevents the default behavior and left alignment takes place. We will fix this issue in our next latest internal build. I have created a PITS item (#1583) that you can use to track the progress of this bug.

Till this get fixed I can suggest you a simple workaround. You have to set HeaderTextAlignment property of the column to Justify.

Thanks for reporting this issue. I have updated your Telerik points.

Greetings,
Stefan Dobrev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Adrian Weidermann
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
Share this question
or