
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I need to sort a column of datagridview object using code after to fill it.
Does anyone have any examples?
Thank you
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Worked . Thank you very much.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi Altair,
This can be done with the "Sort" method using code such as:-
invoke self::dataGridView1::Sort(dataGridView1::Columns["Nome"] , type System.ComponentModel.ListSortDirection::Ascending)
Regards
David

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Worked . Thank you very much.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I also came up with this question today. I had searched the net and found this C # example:
this.dataGridView1.Sort(this.dataGridView1.Columns["Name"], ListSortDirection.Ascending);
at this link: stackoverflow.com/.../sort-datagridview-colums-in-c-sharp-windows-form
but I was not able to successfully convert it from C# to VC without syntax errors.
I was just about ready to give up when I decided I would search this forum. I'm glad I did! Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thank you David.Sands. I works like a champ.