Rapidly changing datagrid

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi all I looking for a bit of help.

I have this app with a datagrid that needs to add rows or edit cells
at a rate of about 100 rows a second (15-16 columns in a row) with
data received through a socket connection, (no user edits will be
allowed, it's strictly a viewer)

I've used static datagrids and datatables in the past so I have a
little knowledge with these, but it seems that assigning the
datasource to my datagrid and then trying to edit and/or add rows very
quickly causes the app to stop responding.

When the app loads I assign an empty datatable (I have set the columns
of course) to the DataGird and then populate it as data is received.
Even in the first round of receiving (where all data is new and not
updates) the app stops responding after about 30 rows.
I've tried the dataRow BeginEdit() methods and dataTable
AcceptChanges() but nothing seems to make any difference. Can the grid
not be used in this way, or am I missing something?

Thanks for your help

Mark
 
Mark,

That seems to be a lot of adds and updates to have to handle. I think
that in this situation, a little work is needed. The grid gets its values
based on reflection, so that alone makes it more than a little slow.

The only thing that I can think of to speed this up would be to write
the values to the grid directly, instead of updating the data set. This
might give you a little bit of a performance boost (since the grid isn't
waiting for events to be fired from the data source, but rather, you are
assigning to it).

Also, you might want to consider using an array of objects which
reflects the kind of data that you are getting from the network, as opposed
to a data set. I imagine the data set has a good amount of overhead
involved in it.

Of course, you might want to consider third-party alternatives, perhaps
something that uses a virtual view (it will request the data as it needs it,
and you can notify it when something changes).

Hope this helps.
 
Thanks for your swift reply.

The thought of being able to edit the cells directly didn't enter my mind, doh!

Mark
 
Back
Top