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

[Solved] Scrollbar size incorrect when using IsVisible on columns

2 Answers 90 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Patrick
Top achievements
Rank 1
Patrick asked on 08 Sep 2010, 04:46 PM
Hello,

I'm using the RadGridView and have many columns initially set as IsVisible=False, they're are only 5 columns and a scrollbar is not present. When I later set IsVisible=True to a few columns the scroll bar appears(on the bottom) as would be expected but its not the correct size. When I move the scrollbar over to the right to see my newly visible columns the size of the scrollbar shrinks as I move over and I don't have a correct indication from the scrollbar of how much more I have to scroll. Eventually if I scroll all the way to the right the scrollbar size is correct the movement of it works as expected. Any ideas on how to get it to size correctly after making columns Visible?
I've noticed this with two different GridViews that we are using in our product. Thank you, Patrick

My GridView in my XAML is set as such:
<telerikGridView:RadGridView x:Name="xRadDataGrid" Visibility="Collapsed" FontSize="14" ItemsSource="{Binding PagedSource,ElementName=xRadDataPager}" Height="455" HorizontalAlignment="Stretch" AutoGenerateColumns="False" Grid.Row="2" ShowGroupPanel="True" VerticalAlignment="Top" ElementExporting="mygrid_ElementExporting" IsReadOnly="True" GotFocus="xRadData_GotFocus" MouseRightButtonUp="xRadDataGrid_MouseRightButtonUp" Sorting="gridPlayerStats_Sorting"/>

2 Answers, 1 is accepted

Sort by
0
Accepted
Yavor Georgiev
Telerik team
answered on 08 Sep 2010, 04:54 PM
Hi Patrick,

 This happens because of column virtualization - when you set IsVisible to the columns and before you scroll to reveal them, they don't yet 'exist' visually, so there's no way to determine their size. You can, however, set the EnableColumnVirtualization property of RadGridView to false, or you can even try manually setting the Width property of your columns (although I'm not sure if the latter approach will work correctly).

Regards,
Yavor Georgiev
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
0
Patrick
Top achievements
Rank 1
answered on 08 Sep 2010, 05:08 PM
Yavor,

EnableColumnVirtualization="False" worked perfectly. Thank you!

-Patrick
Tags
GridView
Asked by
Patrick
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Patrick
Top achievements
Rank 1
Share this question
or