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

UI problem when scrolling and Cell template with popup used.

2 Answers 24 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Valdo
Top achievements
Rank 1
Valdo asked on 12 May 2011, 02:28 PM

Hi, I've a following problem: i'm using custom date picker in cell template. If i open the picker popup and then scroll grid content - the popup will scroll out of bounds of the Grid. I've created a sample to demonstrate this.

MainPage.xaml

<UserControl x:Class="TestSL.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
        xmlns:InputControls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input">
    <Grid>
        <Controls:RadGridView AutoGenerateColumns="False" ItemsSource="{Binding DateSource}" Width="400" Height="200">
            <Controls:RadGridView.Columns>
                <Controls:GridViewDataColumn Header="DatePicker" DataMemberBinding="{Binding}">
                    <Controls:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <InputControls:RadDatePicker SelectedDate="{Binding}" />
                        </DataTemplate>
                    </Controls:GridViewDataColumn.CellTemplate>
                </Controls:GridViewDataColumn>
            </Controls:RadGridView.Columns>
        </Controls:RadGridView>
    </Grid>
</UserControl>

MainPage.xaml.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
  
namespace TestSL
{
    public partial class MainPage : INotifyPropertyChanged
    {
        private List<DateTime> _dateSource = new List<DateTime>();
  
        public MainPage()
        {
            InitializeComponent();
            DataContext = this;
            var source = new List<DateTime>();
            for (var i = 0; i < 20; i++)
            {
                source.Add(DateTime.Now.AddDays(i));
            }
            DateSource = source;
        }
  
        public List<DateTime> DateSource
        {
            get { return _dateSource; }
            private set
            {
                _dateSource = value;
                if (PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("DateSource"));
                }
            }
        }
  
        public event PropertyChangedEventHandler PropertyChanged;
    }
}

Here are the steps:

1) Scroll to the bottom.

2) Click picker's button to open popup.

3) Hover any date picker (mouse wheel doesn't scroll without it for some reason).

4) Scroll grid up.

2 Answers, 1 is accepted

Sort by
0
Valdo
Top achievements
Rank 1
answered on 16 May 2011, 07:51 AM
Is there any fix or workaround for this?
0
Accepted
Yana
Telerik team
answered on 17 May 2011, 04:34 PM
Hello Valdo,

This reason for this issue is that RadDatePicker retains the focus when the dropdown is open - this behavior is by design.  In your case you can workaround it using MouseWheel event of the datapicker and manually closing the dropdown:

private void RadDatePicker_MouseWheel(object sender, MouseWheelEventArgs e)
{
    (sender as RadDatePicker).IsDropDownOpen = false;
}

Please let us know whether this helps.

Greetings,
Yana
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
Valdo
Top achievements
Rank 1
Answers by
Valdo
Top achievements
Rank 1
Yana
Telerik team
Share this question
or