DataGrid numerical sorted instead alphanumerical...

G

Guest

Hi to all,

I have a datagrid filled with string values, and when i click in a header
column the datagrid is alphanumerical sorted , but i need sort some columns
by numeric way...

The datasource of this Datagrid is a DataView, that is a View of a DataTable
(using the property of the datatable.CurrentView)

Do you know how could i solve the sorting problem to have a numerical sort,
instead an alphanumerical sorting?

Thanks a lot.
Josema.
 
T

TT \(Tom Tempelaere\)

Josema,

Josema said:
Hi to all,

I have a datagrid filled with string values, and when i click in a header
column the datagrid is alphanumerical sorted , but i need sort some
columns
by numeric way...

The datasource of this Datagrid is a DataView, that is a View of a
DataTable
(using the property of the datatable.CurrentView)

Do you know how could i solve the sorting problem to have a numerical
sort,
instead an alphanumerical sorting?

Thanks a lot.
Josema.

You could change the type of the column to a numerical type, if the column
only has numbers in it.

If the column mixes alpha and numerical I wouldn't know actually.

Alternatively, you could sort the DataTable yourself in response to clicks
on the header.

By the way, you might consider posting this question in either
microsoft.public.dotnet.framework.windowsforms
or
microsoft.public.dotnet.framework.windowsforms.controls

Hope this helps,
Tom T.
 
J

Josema

Thanks, its was so useful, i have some columns with numerical value, i
will try to localize it, cause my datatable is dinamic (any number of
columns)...

Its a good clue to start with it.

Thanks again.
Josema.
 

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