Completed
Last Updated: 16 Feb 2017 07:11 by ADMIN
ADMIN
Hristo
Created on: 12 Sep 2016 11:02
Category: GridView
Type: Bug Report
1
FIX. RadGridView - scrolling with the mouse wheel after calling the ScrollToRow method for the first row does not display all available rows in the grid
How to reproduce: check the attached video as well

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();

        this.radGridView1.DataSource = this.GetData();
    }

    private DataTable GetData()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Id", typeof(int));
        dt.Columns.Add("Name", typeof(string));
        dt.Columns.Add("Date", typeof(DateTime));
        dt.Columns.Add("Bool", typeof(bool));
        for (int i = 0; i < 10; i++)
        {
            dt.Rows.Add(i, "Name " + i, DateTime.Now.AddDays(i), i % 2 == 0);
        }

        return dt;
    }

    private void radButton1_Click(object sender, EventArgs e)
    {
        this.radGridView1.TableElement.ScrollToRow(0);
        this.radGridView1.Focus();
    }
}

Workaround: call the method if the row is not selected
private void radButton1_Click(object sender, EventArgs e)
{
    if (!this.radGridView1.Rows[0].IsSelected)
    {
        this.radGridView1.TableElement.ScrollToRow(0);    
    }
    
    this.radGridView1.Focus();
}
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments