473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Custom Sorting in DataGrid

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
4 3072
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
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
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

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Alex | last post by:
I created a page to show RealEstate Data with images retrived from the MSSQL 2000. I am using a DataGrid control: <asp:datagrid AllowPaging="True" OnPageIndexChanged="Pageindexchanged" > ...
0
by: Chris Mayers | last post by:
I have a Windows Forms DataGrid that has a DataView as a datasource. My problem is that I want the datagrid to exhibit some special sorting properties when the header rows are clicked on. From...
2
by: DelphiBlue | last post by:
I have a Nested Datagrid that is using a data relations to tie the parent child datagrids together. All is working well with the display but I am having some issues trying to sort the child...
2
by: Mike Irwin | last post by:
I set up sorting by various columns for a DataGrid. For one of the columns, I would like to implement my own sort algorithm, though. For example, the column contains data like: <a...
1
by: melanieab | last post by:
Hi, I found an article that explains how to do the custom sorting. Here is what it says: .... Perhaps you want some custom sorting method to take effect. To do that, DataGrid provides you with...
0
by: Lenny | last post by:
Hello, I have an html table template which I want to turn into ASP.NET custom control. I want to utilize the best features of OOP. I want to be able to create columns headings dynamically, add...
2
by: Jay Walker | last post by:
I created a custom DataGridColumn based on Marcie Robillard's MSDN Article: Creating Custom Columns for the ASP.NET Datagrid...
2
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just...
0
by: Kiran_Juikar | last post by:
I want custom sorting on some of the columns in the datagrid. And i am able to do the same by overriding MouseDown event. Sorting image (little triangle on the column header) goes away as I am not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.