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 8570579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:35:27+00:00 2026-06-11T18:35:27+00:00

We have a custom DataGrid control that dynamically generates columns determined by an XML

  • 0

We have a custom DataGrid control that dynamically generates columns determined by an XML structure.

When creating each of the columns, we’re giving it a starred unit type because we want to ensure theres never any horizontal scrolling in the DataGrid.

            DataGridTextColumn column = new DataGridTextColumn();
            column.Width = new DataGridLength(entity.DisplaySize, DataGridLengthUnitType.Star);

However, we’ve noticed that when the DataGrid is rendered, it renders with the minimum size given to the columns, then once the DataGrid is fully rendered it resizes the columns to properly fit within the DataGrid. This is causing a flicker effect.

Does anyone have any possible solutions? Maybe how to render the DataGrid in the background, then show once the columns are done fidgeting? Or any other ideas?

  • 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-11T18:35:28+00:00Added an answer on June 11, 2026 at 6:35 pm

    This is, unfortunately, normal behavior. It has to do with the way the control is rendered. In WPF, you have layers upon layers of controls, and the DataGrid has no way of knowing what kinds of controls until it has finished rendering.

    So the first layout pass creates the controls, but then it must go through a second pass to measure how large those controls are. Once it knows how large the controls are, it can then begin to resize the columns.

    A DataGrid is an excellent example of a scenario where the highly configurable and dynamic layout system of WPF doesn’t work. To get the kind of performance you are used to, you’ll need to go with a non-WPF grid, one which is able to better predict its own hierarchy and thus perform these kinds of measurements without the need to pre-render everything. Such controls exist for WPF, but you have to find them.

    Here’s one from xceed: http://xceed.com/Grid_WPF_Intro.html?gclid=CNKE8rOBtrICFQfonAodHQ8AEA

    Here’s one from Telerik: http://www.telerik.com/products/wpf/gridview.aspx

    (Because of the need to balance flexibility with performance, and the large number of features expected in a modern datagrid, this control has long been held as the pinnacle of control development. Good datagrids are extremely hard to build. In Excel, Microsoft built an entire application around, essentially, a glorified datagrid. All this to say, you probably won’t find what you’re looking for for free.)

    See this question: WPF DataGrid Vs Windows Forms DataGridView

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

Sidebar

Related Questions

I have custom control that extends DataGrid . It is called ExtendedDataGrid . I
I have a custom control that inherits from a datagrid. I have to evaluate
I have a custom dataGrid that acts more like a 2D list (if that
I have a Silverlight app with a DataGrid containing some custom columns and all
I'm working on creating a custom winforms datagridview control that inherits the built in
I am working on a WPF datagrid custom control, where i have a Day
Background I have a custom control that inherits from a TreeView and is modified
My WPF application has a DataGrid control in it. I have a default custom
I have a custom datagrid in my application that when its source is empty
I have a custom data structure that is pretty much a list of string

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.