Datagridview and collection in VB.net

  • Thread starter Thread starter Vanny
  • Start date Start date
V

Vanny

How to show all rows in the datagridview from a collection? When I try to
populate the datagridview from a list(of T) collection, I can see many rows
but they all the same. It looks like it shows only the last element of the
list.

What I did in code is just build a collection of my class as list and
assign it to the datagridview.datasource. What else should I do?

Thanks in advance for your help

Vanny
 
Vanny,

When you show the code which set the list to the datasource, then it is
probably easier for us to give you some help with that.

Cor
 
Thank you for looking at my question. It is working now, I think it was an
error in the collection.

Vanny
 
Robin,

Why?

By the way the OP uses a geneneric collection with a bindingsource (the
latter I assume, the OP did not show that), the recommended way by
Microsoft.
The generic collection BindList is described for special situations,
therefore I am curious why it is for you in general better?

Cor
 
Back
Top