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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:27:58+00:00 2026-05-17T00:27:58+00:00

I have a very large comma-seperated text-file. I need to display this in a

  • 0

I have a very large comma-seperated text-file. I need to display this in a WPF Datagrid, which method would result in the highest performance of loading all the data to the grid? I’m only aware of two methods:

  • Using a Datatable, and adding each line as row (looks like overkill)
  • Using an ObservableCollection, creates object for each line (looks like overkill)

Is there a third method to fill the Datagrid, which would give higher performance?

  • 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-05-17T00:27:59+00:00Added an answer on May 17, 2026 at 12:27 am

    Depends on what you intend to do with the data. If the data is going to be read only, you can define a List and set it as the ItemsSource for the datagrid. Then the datagrid will automatically create all the rows to represent items in the list.

    If the data is to be manipulated you can use a BindingList<> or an ObservableCollection<>.

    How is “creates object for each line” an overkill? You have to represent a line/row of data as an object. That’s just common sense, it’s not possible to do it any other way.

    Basically, if performance is what you are after then the datagrid’s ItemsSource has to be as light weight as possible. A DataTable might be an overkill, if you don’t intend to use all of it’s features. A List<> on the other hand is as light weight as possible.

    Also note that the WPF datagrid by default uses virtualization, which helps performance as well. There are some caveats thow, like don’t put the datagrid inside a stackpanel otherwise the virtualization effect goes away – you can google about this.

    One final thing, by my experience the .NET4 WPF builtin datagrid has a serious design bug. Basically each DataGridRow consumes 1MB of memory even for the simplest of data. With virtualization and only showing 30 rows, it’s not a huge deal braker – only 30MB of memory consumed. But take a thousand rows, turn off virtualization and the memory consumption is 3GB!!!! On contrast, a WinForm datagridview, consumes more than 10x less memory with the same data. Even with virtualization disabled a thousand rows only takes 30MB…

    I’ve opened a bug about this in Connect, but the specialized experts have yet to look into this issue. Not sure if the WPF toolkit datagrid behaves any better…

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

Sidebar

Related Questions

I have a very large gzip csv file (around 500GB) which I need to
I have a very large data file with around 60000 rows. I need to
I have a very large XML file which has like 40000 data, and when
I need help with regular expression. I have very large collection of text files
I have a large (~100GB) text file structured like this: A,foobar A,barfoo A,foobar B,barfoo
I have a very large Excel sheet converted from a 6000 page PDF file,
I have a very large UIView approx 3000x3000 in size. In this large view
I have a very large program which I have been compiling under visual studio
I have very large dataframe and I need to choose variable number satisfying certain
I need to read from a dataset which is very large, highly interlinked, the

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.