|
-
Aug 11th, 2003, 09:24 AM
#1
Thread Starter
New Member
How to display/update data
Hi,
I'm using VB.NET. Here is what i want:
I have a custom data structure that is 6Bytes large. I need to read some few 100k+ of those packages over the network.
My problem is displaying the data. I tried using a ListView, but it's addListViewItem methode forced me to duplicate each of my records and it slowed my 2GHz+ machine to crawl. My network throughput dropped to 2KB/s.
The next thing I did was using a GridView. I subclassed CollectionBase to hold my data. But once assigned to the View as it's DataSource, the view doesn't get updated, if I read/add new records. If I set the datasource to nothing and reassign my collection, the data gets displayed, but the performance if absolutely inacceptable.
I hope someone has an idea, how to get around this.
-
Aug 11th, 2003, 10:00 AM
#2
Use a custom class instead that inherits from CollectionBase and/or implements IBindableList and then it will work perfectly with a datagrid.
-
Aug 13th, 2003, 03:15 AM
#3
Thread Starter
New Member
Thanks for the answer.
But implementing the IBindingList alone does not solve my problem. I think I need a few more hints. My Class responds to ListChange events although I don't need user input.
Do I need to post an event on adding a new item?
Does this class need to be bound in an other way then through setting
myDataGrid.Datasource = myClassInstance?
-
Aug 13th, 2003, 10:17 AM
#4
Make sure you implmented IBindingList completely and you can use the collectionbase OnInsert and so forth methods to catch ccertain events. I used to have a link to a good article on databinding but I can't seem to find it now, if I do I'll post it.
-
Aug 13th, 2003, 10:23 AM
#5
-
Aug 13th, 2003, 10:48 AM
#6
Thread Starter
New Member
Thanks for your support!
As far as I can see, both of the samples approach the issue from the wrong direction, as they start with a user clicking into the table and thus causing the model to be updated.
I need this, but in reverse order.
It drives me nuts. I think this is so simple and so basic that there must be a solution to this.
I know that for instance in Java you could fire an Event notifying the table that its content has changed.
I could you use a hack setting the datasource to nothing and the reassigening it, but that causes the whole Grid to redraw and this is not neccassary as the data added is mostly outside the view so that only the scrollbar could need an update.
Maybe I'm to much focused on a DataGrid, but I don't know wich other Controls can be bound to an IList/IBindingList or something simmilar.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|