Skip to main content

Confused I need to sort a column of datagridview object using code after to fill it.

Does anyone have any examples?

Thank you

Confused I need to sort a column of datagridview object using code after to fill it.

Does anyone have any examples?

Thank you

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


Confused I need to sort a column of datagridview object using code after to fill it.

Does anyone have any examples?

Thank you

Worked . Thank you very much.


Confused I need to sort a column of datagridview object using code after to fill it.

Does anyone have any examples?

Thank you

Worked . Thank you very much.


Confused I need to sort a column of datagridview object using code after to fill it.

Does anyone have any examples?

Thank you

Worked . Thank you very much.


Confused I need to sort a column of datagridview object using code after to fill it.

Does anyone have any examples?

Thank you

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!


Confused I need to sort a column of datagridview object using code after to fill it.

Does anyone have any examples?

Thank you

Thank you David.Sands. I works like a champ.