I have a collection of objects that can be bound directly as a data source
into a DataViewGrid... works great, but now I can't figure out how to get
the columns sorted in the order that I want, or how to hide certain columns.
Is this possible?

Paul

Re: newbie question by Cowboy

Cowboy
Wed Jun 07 19:20:43 CDT 2006

You may be a newbie, but this is actually a bit more advanced than you might
think. If you want to sort on a single column, you can have your objects
inherit from a sortable collection. If that is not an option, you will have
to figure out the sort method, yourself. A linked list works if you are not
constantly going to pop new objects on and off the "stack".

A custom option that can work is give each object and id and used a sorted
list to sort on the column. You can then grab each object by ID. This is
extremely flexible, but it costs a small amount of overhead. It is the most
flexible if you have to sort on a variety of columns.

Just ideas.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
"PJ6" <noone@nowhere.net> wrote in message
news:uzAtqzmiGHA.4580@TK2MSFTNGP05.phx.gbl...
>I have a collection of objects that can be bound directly as a data source
>into a DataViewGrid... works great, but now I can't figure out how to get
>the columns sorted in the order that I want, or how to hide certain
>columns. Is this possible?
>
> Paul
>



Re: newbie question by PJ6

PJ6
Wed Jun 07 21:07:39 CDT 2006

Not interested in sorting rows.

To rephrase, I'm interested in chaonging the order the columns (i.e. col1,
col2, col3... ) in the grid and also chosing which ones to display. Is that
possible?

Paul

"Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in
message news:uWAueFpiGHA.3496@TK2MSFTNGP02.phx.gbl...
> You may be a newbie, but this is actually a bit more advanced than you
> might think. If you want to sort on a single column, you can have your
> objects inherit from a sortable collection. If that is not an option, you
> will have to figure out the sort method, yourself. A linked list works if
> you are not constantly going to pop new objects on and off the "stack".
>
> A custom option that can work is give each object and id and used a sorted
> list to sort on the column. You can then grab each object by ID. This is
> extremely flexible, but it costs a small amount of overhead. It is the
> most flexible if you have to sort on a variety of columns.
>
> Just ideas.
>
> --
> Gregory A. Beamer
>
> *************************************************
> Think Outside the Box!
> *************************************************
> "PJ6" <noone@nowhere.net> wrote in message
> news:uzAtqzmiGHA.4580@TK2MSFTNGP05.phx.gbl...
>>I have a collection of objects that can be bound directly as a data source
>>into a DataViewGrid... works great, but now I can't figure out how to get
>>the columns sorted in the order that I want, or how to hide certain
>>columns. Is this possible?
>>
>> Paul
>>
>
>



Re: newbie question by Cor

Cor
Thu Jun 08 00:53:32 CDT 2006

PJ6,

Forever has this been Column and styles.

http://msdn2.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumn.aspx

I hope this helps,

Cor


"PJ6" <noone@nowhere.net> schreef in bericht
news:%23ffzWBqiGHA.4284@TK2MSFTNGP05.phx.gbl...
> Not interested in sorting rows.
>
> To rephrase, I'm interested in chaonging the order the columns (i.e. col1,
> col2, col3... ) in the grid and also chosing which ones to display. Is
> that possible?
>
> Paul
>
> "Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in
> message news:uWAueFpiGHA.3496@TK2MSFTNGP02.phx.gbl...
>> You may be a newbie, but this is actually a bit more advanced than you
>> might think. If you want to sort on a single column, you can have your
>> objects inherit from a sortable collection. If that is not an option, you
>> will have to figure out the sort method, yourself. A linked list works if
>> you are not constantly going to pop new objects on and off the "stack".
>>
>> A custom option that can work is give each object and id and used a
>> sorted list to sort on the column. You can then grab each object by ID.
>> This is extremely flexible, but it costs a small amount of overhead. It
>> is the most flexible if you have to sort on a variety of columns.
>>
>> Just ideas.
>>
>> --
>> Gregory A. Beamer
>>
>> *************************************************
>> Think Outside the Box!
>> *************************************************
>> "PJ6" <noone@nowhere.net> wrote in message
>> news:uzAtqzmiGHA.4580@TK2MSFTNGP05.phx.gbl...
>>>I have a collection of objects that can be bound directly as a data
>>>source into a DataViewGrid... works great, but now I can't figure out how
>>>to get the columns sorted in the order that I want, or how to hide
>>>certain columns. Is this possible?
>>>
>>> Paul
>>>
>>
>>
>
>



Re: newbie question by PJ6

PJ6
Thu Jun 08 09:08:02 CDT 2006

Thanks, Cor, just what I was looking for.

Paul

"Cor Ligthert [MVP]" <notmyfirstname@planet.nl> wrote in message
news:OgJ7f%23riGHA.1320@TK2MSFTNGP04.phx.gbl...
> PJ6,
>
> Forever has this been Column and styles.
>
> http://msdn2.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumn.aspx
>
> I hope this helps,
>
> Cor
>
>
> "PJ6" <noone@nowhere.net> schreef in bericht
> news:%23ffzWBqiGHA.4284@TK2MSFTNGP05.phx.gbl...
>> Not interested in sorting rows.
>>
>> To rephrase, I'm interested in chaonging the order the columns (i.e.
>> col1, col2, col3... ) in the grid and also chosing which ones to display.
>> Is that possible?
>>
>> Paul
>>
>> "Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in
>> message news:uWAueFpiGHA.3496@TK2MSFTNGP02.phx.gbl...
>>> You may be a newbie, but this is actually a bit more advanced than you
>>> might think. If you want to sort on a single column, you can have your
>>> objects inherit from a sortable collection. If that is not an option,
>>> you will have to figure out the sort method, yourself. A linked list
>>> works if you are not constantly going to pop new objects on and off the
>>> "stack".
>>>
>>> A custom option that can work is give each object and id and used a
>>> sorted list to sort on the column. You can then grab each object by ID.
>>> This is extremely flexible, but it costs a small amount of overhead. It
>>> is the most flexible if you have to sort on a variety of columns.
>>>
>>> Just ideas.
>>>
>>> --
>>> Gregory A. Beamer
>>>
>>> *************************************************
>>> Think Outside the Box!
>>> *************************************************
>>> "PJ6" <noone@nowhere.net> wrote in message
>>> news:uzAtqzmiGHA.4580@TK2MSFTNGP05.phx.gbl...
>>>>I have a collection of objects that can be bound directly as a data
>>>>source into a DataViewGrid... works great, but now I can't figure out
>>>>how to get the columns sorted in the order that I want, or how to hide
>>>>certain columns. Is this possible?
>>>>
>>>> Paul
>>>>
>>>
>>>
>>
>>
>
>



Re: newbie question by Cowboy

Cowboy
Fri Jun 09 08:16:56 CDT 2006

Yes, turn off the auto fill and manually bind the columns to items. I was
thinking far too complex. Thanks for the callback.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
"PJ6" <noone@nowhere.net> wrote in message
news:%23ffzWBqiGHA.4284@TK2MSFTNGP05.phx.gbl...
> Not interested in sorting rows.
>
> To rephrase, I'm interested in chaonging the order the columns (i.e. col1,
> col2, col3... ) in the grid and also chosing which ones to display. Is
> that possible?
>
> Paul
>
> "Cowboy (Gregory A. Beamer)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in
> message news:uWAueFpiGHA.3496@TK2MSFTNGP02.phx.gbl...
>> You may be a newbie, but this is actually a bit more advanced than you
>> might think. If you want to sort on a single column, you can have your
>> objects inherit from a sortable collection. If that is not an option, you
>> will have to figure out the sort method, yourself. A linked list works if
>> you are not constantly going to pop new objects on and off the "stack".
>>
>> A custom option that can work is give each object and id and used a
>> sorted list to sort on the column. You can then grab each object by ID.
>> This is extremely flexible, but it costs a small amount of overhead. It
>> is the most flexible if you have to sort on a variety of columns.
>>
>> Just ideas.
>>
>> --
>> Gregory A. Beamer
>>
>> *************************************************
>> Think Outside the Box!
>> *************************************************
>> "PJ6" <noone@nowhere.net> wrote in message
>> news:uzAtqzmiGHA.4580@TK2MSFTNGP05.phx.gbl...
>>>I have a collection of objects that can be bound directly as a data
>>>source into a DataViewGrid... works great, but now I can't figure out how
>>>to get the columns sorted in the order that I want, or how to hide
>>>certain columns. Is this possible?
>>>
>>> Paul
>>>
>>
>>
>
>