By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,960 Members | 2,324 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,960 IT Pros & Developers. It's quick & easy.

Custom Sorting in DataGrid

P: n/a
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
Sep 22 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Ambica,

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

Cor

"Ambica Jain" <Am********@discussions.microsoft.comschreef in bericht
news:8E**********************************@microsof t.com...
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

Sep 23 '06 #2

P: n/a
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.
"Cor Ligthert [MVP]" wrote:
Ambica,

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

Cor

"Ambica Jain" <Am********@discussions.microsoft.comschreef in bericht
news:8E**********************************@microsof t.com...
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


Sep 25 '06 #3

P: n/a
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
"Ambica Jain" <Am********@discussions.microsoft.comschreef in bericht
news:05**********************************@microsof t.com...
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.
"Cor Ligthert [MVP]" wrote:
>Ambica,

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

Cor

"Ambica Jain" <Am********@discussions.microsoft.comschreef in bericht
news:8E**********************************@microso ft.com...
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



Sep 26 '06 #4

P: n/a

Cor Ligthert [MVP] wrote:
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
"Ambica Jain" <Am********@discussions.microsoft.comschreef in bericht
news:05**********************************@microsof t.com...
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.
"Cor Ligthert [MVP]" wrote:
Ambica,

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

Cor

"Ambica Jain" <Am********@discussions.microsoft.comschreef in bericht
news:8E**********************************@microsof t.com...
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
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

Oct 10 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.