Datagridview sort

A

Arne Garvander

When I click a column in my datagrid a sort occur.
If I click the column with dates, it sorts in m/d/y order. I would like it
to either sort in y/m/d order or I would like to turn off the sort.
It seems like by date is in a text format. Maybe I can change the data type
to datetime and the sort will work again.
(In worst case I have to change my dates to figs, maybe figs sort better
than dates)
 
A

AMercer

When I click a column in my datagrid a sort occur.
If I click the column with dates, it sorts in m/d/y order. I would like it
to either sort in y/m/d order or I would like to turn off the sort.
It seems like by date is in a text format. Maybe I can change the data type
to datetime and the sort will work again.
(In worst case I have to change my dates to figs, maybe figs sort better
than dates)

With DataGridView (I don't know about datagrid), you should make your data
be a date rather than a string. You will then sort chronologically, and the
dates can be displayed in any date format. Ditto for other value types.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top