Completed
Last Updated: 21 Aug 2015 13:46 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 29 Jul 2013 04:55
Category: GridView
Type: Bug Report
3
FIX. RadGridView - with AutoSizeRows = true cuts off the first row after scrolling Top to Bottom and Bottom to Top
Description: When we scroll the RadGridView from Top to Bottom and Bottom to Top the first record is cut off, if we click the refresh button then it will be displayed properly. 

To reproduce:
- add a RadGridView to a form
- add a RadButton to a form
- use the following code snippet:

public Form1()
        {
            InitializeComponent();

            radGridView1.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.None;
            radGridView1.EnableCustomFiltering = false;
            this.radGridView1.AutoSizeRows = true;

            radGridView1.Columns["CustomerID"].Width = 100;
            radGridView1.Columns["CompanyName"].Width = 150;
            radGridView1.Columns["ContactName"].Width = 150;
            radGridView1.Columns["Country"].Width = 100;
            radGridView1.Columns["Phone"].Width = 90;
            radGridView1.Columns["Fax"].Width = 90;

            radGridView1.Columns["Phone"].AllowFiltering = false;
            radGridView1.Columns["Fax"].AllowFiltering = false;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'nwindDataSet.Customers' table. You can move, or remove it, as needed.
            this.customersTableAdapter.Fill(this.nwindDataSet.Customers);

        }

        private void radButton1_Click(object sender, EventArgs e)
        {
            Form1_Load(sender, e);
        }
5 comments
ADMIN
Stefan
Posted on: 22 Jul 2015 13:56
Will pass it forward. Thanks.
Steven
Posted on: 22 Jul 2015 13:43
To give credit where credit is due, the workaround idea was given to me from Telerik Admin Dess.
ADMIN
Stefan
Posted on: 22 Jul 2015 13:29
Thanks for sharing your workaround with the community.
Steven
Posted on: 15 Jul 2015 12:00
The following workaround is working for us.  Add an event handler to the RadGridView:

this.TableElement.VScrollBar.ValueChanged +=new EventHandler(VScrollBar_ValueChanged);

Then do this:

        private void VScrollBar_ValueChanged(object sender, EventArgs e)
        {
            if (this.TableElement.VScrollBar.Value == 0)
                this.MasterTemplate.Refresh();
        }

I realize that throwing a workaround on here may decrease the number of votes for fixing this issue... so please, if you came here looking for a workaround, use it, but also give this issue an upvote so it'll get fixed!
Darren
Posted on: 15 Jul 2015 00:01
Is there a workaround for this bug?