When a cell has multi-lined wrapped text, and both vertical and grid extends beyond window size (have both vertical and horizontal scroll):
Scrolling vertical scroll to the bottom, then horizontal to the right causes the vertical scrollbar to jump away from bottom.
XAML
<Window x:Class="GridScrollbarIssue.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:TelerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
Title="MainWindow" Height="350" Width="400">
<Grid>
<TelerikGridView:RadGridView ItemsSource="{Binding Collection}" AutoGenerateColumns="False">
<TelerikGridView:RadGridView.Columns>
<TelerikGridView:GridViewDataColumn Header="Column 1" DataMemberBinding="{Binding Col1}" Width="125" IsFilterable="True" >
</TelerikGridView:GridViewDataColumn>
<TelerikGridView:GridViewDataColumn Header="Column 2" DataMemberBinding="{Binding Col2}" Width="125" IsFilterable="True" >
</TelerikGridView:GridViewDataColumn>
<TelerikGridView:GridViewDataColumn Header="Column 3" DataMemberBinding="{Binding Col3}" Width="125" IsFilterable="True" >
</TelerikGridView:GridViewDataColumn>
<TelerikGridView:GridViewDataColumn Header="Column 4" DataMemberBinding="{Binding Col4}" Width="125" IsFilterable="True" >
</TelerikGridView:GridViewDataColumn>
<TelerikGridView:GridViewDataColumn Header="Column 5" DataMemberBinding="{Binding Col5}" Width="125" IsFilterable="True" TextWrapping="Wrap">
</TelerikGridView:GridViewDataColumn>
</TelerikGridView:RadGridView.Columns>
</TelerikGridView:RadGridView>
</Grid>
</Window>
C#:
using System.Collections.ObjectModel;
using System.Windows;
namespace GridScrollbarIssue
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public ObservableCollection<Model> Collection { get; set; }
public MainWindow()
{
Collection = CreateCollection();
InitializeComponent();
}
private static ObservableCollection<Model> CreateCollection()
{
return new ObservableCollection<Model>
{
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
new Model
{
Col1 = "",
Col2 = "col2",
Col3 = "col3",
Col4 = "col4",
Col5 =
"test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test "
},
};
}
}
public class Model
{
public string Col1 { get; set; }
public string Col2 { get; set; }
public string Col3 { get; set; }
public string Col4 { get; set; }
public string Col5 { get; set; }
}
}