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

alternating row color skipping rows when scrolling with mouse wheel

2 Answers 87 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 02 Mar 2012, 06:30 PM
We are having a problem with our alternating row color on the grid view.  Basically, the alternating color is not painted on all rows if you scroll wheel down a grid fast enough.  It may not just be limited to scroll wheel, but it seems more pronounced then.  It basically skips over the rows in terms of painting them with the alternating color.  They paint just as a standard row.  If you then click on some of the rows that should have been painted, they then paint and repair themselves.

Telerik: 2012.1.12.215 (and the versions from last year had same problem)

2 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 05 Mar 2012, 12:44 PM
Hi Eric,

I've tried this and haven't been able to replicate your issue. I've put together a very simple exmaple for you to try to see if it works ok for you. It just assumes you have a RadGridView on a Form.

Hope that helps, but let me know if you have further questions
Richard

using System.Windows.Forms;
using Telerik.WinControls.UI;
using System.Collections.Generic;
 
 
 
namespace RadControlsWinFormsApp1
{
    public partial class Form1 : Form
    {
        private List<Person> people = new List<Person>();
 
 
        public Form1()
        {
            InitializeComponent();
 
 
            this.radGridView1.EnableAlternatingRowColor = true;
 
            int i = 1;
            while (i <= 200)
            {
                people.Add(new Person(i, "Person " + i.ToString()));
                i++;
            }
 
            this.radGridView1.AutoGenerateColumns = true;
 
            this.radGridView1.DataSource = people;
        }
    }
 
    public class Person
    {
        public Person(int id, string name)
        {
            this.Id = id;
            this.Name = name;
        }
 
        public int Id
        { get; set; }
 
        public string Name
        { get; set; }
 
    }
}
0
Jack
Telerik team
answered on 07 Mar 2012, 09:55 AM
Hello Eric,

This issue can appear when using CellFormatting or ViewCellFormatting events to apply custom formatting. Please note that the properties locally set in these events have greater priority than alternating rows. 

If the issue continues to appear, please open a support ticket and send us a sample project which reproduces the issue. We will be glad to help further.

@Richard, thank you for the sample project.
 
All the best,
Jack
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Eric
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Jack
Telerik team
Share this question
or