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

CSV as Data Source

1 Answer 165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Charles
Top achievements
Rank 1
Charles asked on 27 Nov 2018, 08:44 PM

I've been fighting with a solution - I have to take a flat file, sometimes 200 mb or larger and and display that in a grid.

Stripping the data from the file is a snap using any one of several methods, but getting into a useful object the Grid can use becomes a real time-crusher.

The raw data is comma-delimited text with headers.

Is it possible to feed a csv into the grid?  If so, how?

I can't provide sample code because of security and time constraints.

The most promising approach has been query the the target file using OleDb classes including a OleDbDataReader.  Reading a 400k records file into a data table takes about 20 seconds give or take.  Applying that to a Grid just blows everything out of the water.  Virtual scrolling doesn't help.  I simply can't get a large file to display in your grid helper.

Grid for JS doesn't work any better.

 

Can the Grid actually display a datasource of that size in a reasonable amount of time?  Like less than a minute?

 

 

 

1 Answer, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 29 Nov 2018, 03:36 PM
Hi Charles,

Passing 400K data items to the client to be handled by the Grid DataSource will result in slow performance and possibly a browser crash in IE. This is too large data to keep in-memory in a browser. Theoretically, 400K data items could be passed to the Grid, like in this example https://dojo.telerik.com/iRODafof, but the result depends on many things:
  • the size of the data items themselves (number and size of fields)
  • the client-side features enabled in the Grid
  • templates in the Grid columns

To get reasonable behavior with large data like that, data should be kept on the server in a temporary store or copied to a database to be requested by the Grid using server-side paging (returning only the current page of data on the client) or virtual scrolling with server-side paging of the DataSource. In this way, only small portions of the data will be returned and loaded on the client during paging.

Regards,
Tsvetina
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Charles
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Share this question
or