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

Horizontal Scrolling changes Column Widths

2 Answers 220 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 06 Dec 2011, 10:40 AM
I'm using GridView version 2011.3.1116.40.

<telerik:RadGridView ItemsSource="{Binding Jobs}" AutoGenerateColumns="False" ShowInsertRow="False"
                     IsReadOnly="False" CanUserDeleteRows="False" CanUserFreezeColumns="True"
                     CanUserInsertRows="False" CanUserReorderColumns="True" CanUserSelect="True"
                     RowIndicatorVisibility="Collapsed" Margin="0,0,0,-12" >
    <telerik:RadGridView.RowDetailsTemplate>
        <DataTemplate>
            <telerik:RadTabControl TabStripPlacement="Left" TabOrientation="Vertical">
                <telerik:RadTabItem Header="History">
                    <telerik:RadGridView ItemsSource="{Binding History}" AutoGenerateColumns="False" ShowGroupPanel="False" ShowInsertRow="False" IsReadOnly="True">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn Name="ActionDate" DataMemberBinding="{Binding ActionDate}" Header="Date" DataFormatString="{} {0:D}" />
                            <telerik:GridViewDataColumn Name="ActionTime" DataMemberBinding="{Binding ActionTime}" Header="Time" />
                            <telerik:GridViewComboBoxColumn ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=Page}, Path=DataContext.Users}"
                                                                SelectedValueMemberPath="OID"
                                                                DataMemberBinding="{Binding UserInitiator}"
                                                                DisplayMemberPath="FullName"
                                                                Header="Name"
                                                                IsComboBoxEditable="False" />
 
                            <telerik:GridViewComboBoxColumn DisplayMemberPath=""
                                                                ItemsSource="{Binding Source={StaticResource historyEventType}}"
                                                                DataMemberBinding="{Binding HistoryType}"
                                                                Header="Action"
                                                                IsComboBoxEditable="False" />
                            <telerik:GridViewDataColumn Name="Reason" DataMemberBinding="{Binding ReasonDescription}" Header="Reason" DataFormatString="{} {0:D}" />
 
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding Notes}" Header="Notes"/>
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </telerik:RadTabItem>
 
            </telerik:RadTabControl>
 
        </DataTemplate>
    </telerik:RadGridView.RowDetailsTemplate>           
    <telerik:RadGridView.Columns>
        <telerik:GridViewToggleRowDetailsColumn ExpandMode="Single" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding FeederSourceName}" Header="Feeder Source" IsReadOnly="True"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding NPSOffenceDescription}" Header="Offence Code" IsReadOnly="True"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding NPSLocation}" Header="Location" IsReadOnly="True"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding VRM}" Header="VRM" IsReadOnly="True"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding NPSMakeModel}" Header="Make/Model" IsReadOnly="True"/>               
        <telerik:GridViewDataColumn DataMemberBinding="{Binding TimeStampDate}" Header="Offence Date" DataFormatString="{} {0:D}" IsReadOnly="True"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding TimeStampTime}" Header="Offence Time" IsReadOnly="True"/>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding ProcessedDatePart}" Header="Input Date" DataFormatString="{} {0:D}" IsReadOnly="True"/>
 
        <telerik:GridViewDataColumn DataMemberBinding="{Binding ProcessedTimePart}" Header="Input Time" IsReadOnly="True" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Status}" Header="Status" IsReadOnly="True" />
        <telerik:GridViewComboBoxColumn ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=Page}, Path=DataContext.Queues}"
                                                                SelectedValueMemberPath="OID"
                                                                IsReadOnly ="{Binding RelativeSource={RelativeSource AncestorType=Page}, Path=DataContext.CanChangeJobQueue, Converter={StaticResource NotConverter}}"
                                                                DataMemberBinding="{Binding Queue!Key}"
                                                                DisplayMemberPath="Name"
                                                                Header="Assign To Queue"
                                                                IsComboBoxEditable="True"/>
 
    </telerik:RadGridView.Columns>
</telerik:RadGridView>


When a page is initally loaded, my column widths are fine and default to that of the longest value. The grid is too wide for the page so I can scroll it horizontally.

If I use the thumb on the scroll bar to move right 'slowly' then the widths are preserved (see attachment 'small scroll to right'). However, if I scroll to the right more aggresively using the scroll bars 'Large Change' value then the width of the columns on the right all seem to expand to match a common denominator that I don't want (see attachment 'large scroll to right').

Is there a property I can set on the grid or columns to stop this automatic resizing? Thanks for your time!

Paul



2 Answers, 1 is accepted

Sort by
0
Accepted
Dimitrina
Telerik team
answered on 06 Dec 2011, 12:17 PM
Hi Paul,

Indeed there was such an issue with resizing the columns while scrolling. It was recently resolved.

The fix is available after the latest internal build  with version 2011.3.1129. Please let me know if you can reproduce the problem with the latest assemblies.

Best wishes,
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Paul
Top achievements
Rank 1
answered on 06 Dec 2011, 02:06 PM
Thanks for the reply Didie.

I've just applied version 2011.3.1205 and the problem has disappeared!

Paul
Tags
GridView
Asked by
Paul
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Paul
Top achievements
Rank 1
Share this question
or