Custom Sorting in DataGrid

G

Guest

Hi,

I want custom sorting on some of the columns in the datagrid. And i am able
to do the same by overriding MouseDown event. However, i need to rebind my
datatable to reflect the changes in grid. And with rebinding, sorting image
(little triangle on the column header) goes away.

I need to show sorting image as well custom sorting. Please help.

Thanks
 
C

Cor Ligthert [MVP]

Ambica,

What you mean with custom sorting, in my idea is sorting setting something
in a sequence based on numbers or characters.

Cor
 
G

Guest

When you click on column header, the text column is sorted by default
according to text sorting. But i want different sorting, i.e. if values are
A1, A11, A12, A2, instead of having values as A1, A11, A12, A2, i want A1,
A2, A11, A12.
So, i have written my own sorting algo, which i call on Mouse down event.
But to update grid with this order, i need to rebind my datatable, which
causes the sorting image to disappear.
 
C

Cor Ligthert [MVP]

Ambica,

A1, A11, A12 is a correct sort, it is not a numeric value you know.
In my idea should you use A01, A11, A12 than your problem is gone.

If you want that in an other way than it is the same as asking that you want
to be placed in sequence.

Microsoft, Apple, IBM in that way, which is no sort but just placing things
on a row. You can sort them however if you have an independent numeric
identifier with that 1, 2, 3.

Just my thought,

Cor
 
M

Milan

Cor said:
Ambica,

A1, A11, A12 is a correct sort, it is not a numeric value you know.
In my idea should you use A01, A11, A12 than your problem is gone.

If you want that in an other way than it is the same as asking that you want
to be placed in sequence.

Microsoft, Apple, IBM in that way, which is no sort but just placing things
on a row. You can sort them however if you have an independent numeric
identifier with that 1, 2, 3.

Just my thought,

Cor
Hi ,
I have similar problem.
Want to sort datatable column wise means
First column shld be A1, secon B1 and third C1
Is it possible. pls help me

Milan
 

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