472,353 Members | 1,500 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 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 2993
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...
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...
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...
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,...
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...
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...
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...
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...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.