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

Gridview Vertical Scrollbar - last item not fully visible

5 Answers 233 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jean
Top achievements
Rank 1
Jean asked on 01 Mar 2012, 12:18 PM
Hello,

I attach the sources to reproduce the issue. I used Q3 2011. I've a grid bound to a list of items that have a property "Name". This name can be wrapped inside the datatemplate of the gridview column. If you scroll down to the bottom of the grid, the last item is not fully visible (please see attached screenshot for details). In some cases the last item is not visible at all, depending on the size of the wrapped text and the width of the column. I've played with different sizes and was able to reproduce the issue.

We have an application in production and this issue is very important for us.

Notes: In the example, to generate test data I've used "nbuilder" that can be obtained from NuGet.

<Window x:Class="GridViewBug.MainWindow"
        Title="MainWindow"
        WindowState="Maximized"
        WindowStartupLocation="CenterScreen" Loaded="Window_Loaded">
    <telerik:RadGridView ItemsSource="{Binding Items}" Margin="20" AutoGenerateColumns="False">
        <telerik:RadGridView.Columns>
            <telerik:GridViewColumn Width="300" Header="Data">
                <telerik:GridViewColumn.CellTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Name}" TextWrapping="Wrap"  />
                    </DataTemplate>
                </telerik:GridViewColumn.CellTemplate>
            </telerik:GridViewColumn>
        </telerik:RadGridView.Columns>
    </telerik:RadGridView>
</Window>

using System.Windows;
 
namespace GridViewBug
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
 
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            DataContext = new MainWindowViewModel();
            ((MainWindowViewModel)DataContext).Test();
        }
    }
}

using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using FizzWare.NBuilder;
using FizzWare.NBuilder.Generators;
 
namespace GridViewBug
{
    public class Stuff
    {
        public string Name { get; set; }
    }
 
    public class MainWindowViewModel : INotifyPropertyChanged
    {
        private PropertyChangedEventHandler _propertyChangedEvent;
        public event PropertyChangedEventHandler PropertyChanged
        {
            add
            {
                _propertyChangedEvent += value;
            }
            remove
            {
                _propertyChangedEvent -= value;
            }
        }
 
        protected virtual void NotifyPropertyChanged(string name)
        {
            PropertyChangedEventHandler handler = _propertyChangedEvent;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }
 
        private List<Stuff> _items;
        public List<Stuff> Items
        {
            get { return _items; }
            set
            {
                _items = value;
                NotifyPropertyChanged("Items");
            }
        }
 
        public void Test()
        {
            string phrase = GetRandom.Phrase(130);
            Items = Builder<Stuff>.CreateListOfSize(70).All().With(x => x.Name = phrase).Build().ToList();
        }
    }
}


Feedback is appreciated.

Thanks.

5 Answers, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 01 Mar 2012, 03:38 PM
Hello Jean,

Actually, you have hit a known issue. It is logged into our PITS and you can track its status here.  
Excuse us for the inconvenience caused.

All the best,
Vera
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Waut
Top achievements
Rank 1
answered on 25 Sep 2013, 08:47 AM
hello

Sorry to bump this old post, but the bugtracker says it is solved in the Q3 of 2012. But I'm using those files and have the same problem, see screenshot attached.
The referenced dll have version number 2012.3.1203.40.

As you can see, I use it in a RadTabControl, but even if I set the padding it is still that way

Edit: For my cellitems I define a custom layout like below and when I disable that I've got no problem with it
<Style x:Key="UnderlinedGridCell" TargetType="grid:GridViewCell">
        <Setter Property="Template" Value="{StaticResource GridViewCellTemplate}"/>
        <Setter Property="Margin" Value="0 0 10 0"/>
        <Setter Property="Padding" Value="0 3 20 6"/>
        <Setter Property="BorderBrush" Value="{DynamicResource HeadSplitterBrush}"/>
        <Setter Property="BorderThickness" Value="0 0 0 1" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="FontWeight" Value="Regular"/>
    </Style>
 
<ControlTemplate x:Key="GridViewCellTemplate" TargetType="grid:GridViewCell">
        <Grid>
            <Border x:Name="PART_CellBorder"
                Margin="1 0 0 0"
                Background="{Binding Background, RelativeSource={RelativeSource TemplatedParent}}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}" />
 
            <Border x:Name="Background_Over"
                        Margin="1 1 2 2" BorderThickness="1" CornerRadius="1"
                        BorderBrush="{DynamicResource ItemOuterBorderOver}"
                        Grid.Column="2" Grid.ColumnSpan="2"  Visibility="Collapsed">
                <Border BorderThickness="1"
                            BorderBrush="{DynamicResource ItemInnerBorderOver}"
                            Background="{DynamicResource ItemBackgroundOver}" />
            </Border>
 
            <Border x:Name="Background_Selected"
                        Margin="1 1 2 2" BorderThickness="1" CornerRadius="1"
                        BorderBrush="{DynamicResource ItemOuterBorderSelected}"
                        Grid.Column="2" Grid.ColumnSpan="2" Visibility="Collapsed">
                <Border BorderThickness="1"
                            BorderBrush="{DynamicResource ItemInnerBorderSelected}"
                            Background="{DynamicResource ItemBackgroundSelected}" />
            </Border>
 
            <Border x:Name="Background_Current"
                        Margin="1 1 2 2" BorderThickness="1" CornerRadius="1"
                        BorderBrush="{DynamicResource ControlOuterBorder}"
                        Grid.Column="2" Grid.ColumnSpan="2" Visibility="Collapsed" />
 
            <Border x:Name="Background_Invalid"
                    Background="{DynamicResource ItemBackground}"
                    Margin="1 1 2 2" BorderThickness="1" CornerRadius="1"
                    BorderBrush="{DynamicResource ControlOuterBorderInvalid}"
                    Grid.Column="2" Grid.ColumnSpan="2" Visibility="Collapsed">
                <Grid Height="12" HorizontalAlignment="Right" Margin="1 -4 -4 0" VerticalAlignment="Top" Width="12" Background="Transparent">
                    <Path Fill="{DynamicResource ControlOuterBorderInvalid}" Margin="1 3 0 0" Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z"/>
                    <Path Fill="{DynamicResource ControlInnerBorderInvalid}" Margin="1 3 0 0" Data="M 0,0 L2,0 L 8,6 L8,8"/>
                </Grid>
            </Border>
 
            <Border x:Name="Background_Invalid_Unfocused"
                        Margin="1 1 1 2" BorderThickness="1" CornerRadius="1"  Visibility="Collapsed"
                        BorderBrush="{DynamicResource ItemOuterBorderInvalid}"
                        Grid.Column="2" Grid.ColumnSpan="2" Opacity="1">
                <Border BorderThickness="1"
                            BorderBrush="{DynamicResource ItemInnerBorderInvalid}"
                            Background="{DynamicResource ItemBackgroundInvalid}" />
            </Border>
 
            <Border x:Name="Background_Disabled"
                        BorderThickness="1" Margin="0 0 1 1"
                        Background="{DynamicResource ItemBackgroundDisabled}"
                        BorderBrush="{DynamicResource ItemInnerBorderDisabled}"
                        Grid.Column="2" Grid.ColumnSpan="2" Visibility="Collapsed">
 
            </Border>
 
            <ContentPresenter x:Name="PART_ContentPresenter"
                                Margin="{TemplateBinding Padding}"
                                Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
 
 
        </Grid>
    </ControlTemplate>
0
Vera
Telerik team
answered on 26 Sep 2013, 08:42 AM
Hi Waut,

May I ask you to download our latest official version - Q2 2013 SP and to give it a try? In case the problem still occurs, please send a simple project demonstrating it so we can debug it on our side.


Regards,
Vera
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Waut
Top achievements
Rank 1
answered on 26 Sep 2013, 09:37 AM
Hello Vera

Thank you for the quick response. Unfortunattely the company hasn't paid for a new subscription (yet ;)), but I found a workaround: setting the cellheight. The the problem is fixed. When they subscribe again I'll test this.

Greetings
0
Dimitrina
Telerik team
answered on 26 Sep 2013, 10:12 AM
Hello,

Thank you for sharing your solution with the community. 

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
Jean
Top achievements
Rank 1
Answers by
Vera
Telerik team
Waut
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or