Home All Groups Group Topic Archive Search About

DataGridView in 2.0 Framework - Sorting

Author
14 Nov 2006 3:21 PM
Chris Moore
All,

I am having a considerable amount of difficulty with what should be a
very simple problem. I have a DataGridView that is bound to a
collection of objects that displays (and edits) selected objects
appropriately. However, I can find no way to activate sorting by
column. I want to be able to do the normal thing: click on a column and
have the rows sort (alphabetically) according to the contents of the
selected column. According to the documentation, I should be able to
set the column's sort mode to "Automatic" and the sort glyph should
become available on the column. This, however, does not happen. The
sort glyph does not appear and thus I cannot sort. Anybody know what
the heck's going on here?

Thanks
Chris.

Author
14 Nov 2006 3:49 PM
Bill Block
Consider using a SortableBindingList implementation.  Michael Weinhardt
wrote a good article on it for MSDN a while ago...

http://msdn2.microsoft.com/en-us/library/ms993236.aspx

Bill
Author
14 Nov 2006 4:42 PM
Kevin Spencer
Check out the official DataGridView FAQ:

http://www.windowsforms.net/Samples/Go%20To%20Market/DataGridView/DataGridView%20FAQ.doc


--
HTH,

Kevin Spencer
Microsoft MVP
Ministry of Software Development
http://unclechutney.blogspot.com

Any experience you can walk away from
is a good one.



Show quote
"Chris Moore" <CMo***@gmail.com> wrote in message
news:1163517672.635468.176850@b28g2000cwb.googlegroups.com...
> All,
>
> I am having a considerable amount of difficulty with what should be a
> very simple problem. I have a DataGridView that is bound to a
> collection of objects that displays (and edits) selected objects
> appropriately. However, I can find no way to activate sorting by
> column. I want to be able to do the normal thing: click on a column and
> have the rows sort (alphabetically) according to the contents of the
> selected column. According to the documentation, I should be able to
> set the column's sort mode to "Automatic" and the sort glyph should
> become available on the column. This, however, does not happen. The
> sort glyph does not appear and thus I cannot sort. Anybody know what
> the heck's going on here?
>
> Thanks
> Chris.
>

AddThis Social Bookmark Button