Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8465965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:12:11+00:00 2026-06-10T15:12:11+00:00

I have an application that needs to display a grid of data consisting mostly

  • 0

I have an application that needs to display a grid of data consisting mostly of boolean values, and checkbox columns fit the bill. There will be about 40-60 checkbox columns with around 200 rows. I thought it would be trivial to do something like that in WPF.

I am unable to even get near a decent horizontal scrolling experience with WPF. To see what I’m talking about, create a Window and place a DataGrid on it, and set AutoGenerateColumns="True", then add the following in the constructor after InitializeComponent();:

dataGrid1.ItemsSource = Create(200, i => new { b1 = true, b2 = false, b3 = true, b4 = false, b5 = true, b6 = false, b7 = true, b8 = false, b9 = true,
                                               b10 = false, b11 = true, b12 = false, b13 = true, b14 = false, b15 = true, b16 = false, b17 = true, b18 = false, b19 = true, b20 = false, b21 = true,
                                               b22 = false, b23 = true, b24 = false, b25 = true, b26 = false, b27 = true, b28 = false, b29 = true, b30 = false, b31 = true, b32 = false });

It requires this method, add it too:

ObservableCollection<T> Create<T>(int count, Func<int, T> creator)
{
    return new ObservableCollection<T>(Enumerable.Range(0, count).Select(creator));
}

Run the application, and attempt to scroll horizontally. Horrible, isn’t it? Vertical scrolling isn’t too hot either.

I did the same with a WinForms application and scrolling was butter smooth in all directions, and looked as good as WPF after forcing the DataGridView‘s DoubleBuffered property to true. To compare, create a new Form, plop a DataGridView and add the following to the constructor after InitializeComponent();:

typeof(DataGridView).GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(dataGridView1, true, null);
for (int i = 0; i < 64; i++)
    dataGridView1.Columns.Add(new DataGridViewCheckBoxColumn {HeaderText = "C" + i, Width = 30});
for (int i = 0; i < 400; i++)
    dataGridView1.Rows.Add();

This has twice the number of columns, twice the number of rows, and it scrolls as smooth as a newborn’s bottom, both horizontally and vertically.

But unfortunately I can’t do what I need with WinForms. I need templated columns. I need composability.

To solve the scrolling issue in WPF, I tried all combinations of the following:

  • EnableColumnVirtualization (true/false)
  • EnableRowVirtualization (true/false)
  • ScrollViewer.CanContentScroll (true/false) – false improves vertical scrolling only
  • Fixed-sized columns
  • Fixed-sized data grid
  • VirtualizingStackPanel.VirtualizationMode (Recycling/Standard) – Recycling has a bug where it will recycle a CheckBox control that is checked and place it in a new row where it should be unchecked, causing a fading out animation. This makes checkboxes appear to have a “ghosting” effect.
  • ScrollViewer.IsDeferredScrollingEnabled – I’m sorry but I can’t accept downgrading to Windows 3.1-style scrolling for something so trivial.

I’m willing to accept subpar performance. I don’t expect anything like the smoothness of WinForms (WPF is after all giving me so much more, although this should have been offset by WPF’s GPU acceleration). I just want something usable, even just barely usable.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T15:12:12+00:00Added an answer on June 10, 2026 at 3:12 pm

    As stated in my comment I am not sure of the question. If you are looking for performance of a grid in WPF then go ListView / GridView. Unless there are some feature of DataGrid you have to have. It is more code but worth it. I have a GridView with 40 columns and 1000 rows and good performance (and DataGrid performance was bad).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Silverlight application that needs to display data in both English (feet,
I have a Java application that needs to display large amounts of data (on
I have an ExtJS application that needs to display an html document within a
I have a Rails 3 application that needs to display images from another application.
We have a GWT application that needs to display various holidays. Is there a
I have a master page that needs to display some data from my database.
I have a Silverlight application that needs to scroll some data (like stock information)
I have an application that needs to display 1 to N custom controls in
I have a web application that needs to display 30,000 markers on a map
I have a mapping application that needs to draw a path, and then display

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.