I have a List<> of objects that I want to use as the datasource for my
datagridview at runtime. However, when I bind to it, the columns are in a
strange order (no correlation to my query or to the underlying object
properties). Any idea how to manipulate the order of object properties,
either on the datagridview or in the underlying list?

E.g., the grid displays
object.LastName object.ID object.FirstName

But it SHOULD display
object.ID object.LastName object.FirstName

RE: How do I change the order of object properties stored in Generics by jacobryce

jacobryce
Mon Mar 13 16:29:21 CST 2006

Nevermind, I just needed to set the datagridview's AutoGenerateColumns to
false.

"jacobryce" wrote:

> I have a List<> of objects that I want to use as the datasource for my
> datagridview at runtime. However, when I bind to it, the columns are in a
> strange order (no correlation to my query or to the underlying object
> properties). Any idea how to manipulate the order of object properties,
> either on the datagridview or in the underlying list?
>
> E.g., the grid displays
> object.LastName object.ID object.FirstName
>
> But it SHOULD display
> object.ID object.LastName object.FirstName
>
>
>