473,769 Members | 2,106 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3100
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********@dis cussions.micros oft.comschreef in bericht
news:8E******** *************** ***********@mic rosoft.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********@dis cussions.micros oft.comschreef in bericht
news:8E******** *************** ***********@mic rosoft.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********@dis cussions.micros oft.comschreef in bericht
news:05******** *************** ***********@mic rosoft.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********@dis cussions.micros oft.comschreef in bericht
news:8E******* *************** ************@mi crosoft.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********@dis cussions.micros oft.comschreef in bericht
news:05******** *************** ***********@mic rosoft.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********@dis cussions.micros oft.comschreef in bericht
news:8E******** *************** ***********@mic rosoft.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
4442
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" > Sub PageIndexChanged(ByVal sende.........)
0
1645
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 reading round the newsgroups, it seems that a custom 'IComparer' is the answer, but I'm not quite sure how to do this. Really, how to get at the IComparer that the DataGrid/DataView uses for sorting. Can anyone point me towards a nice example...
2
945
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 datagrid. HTML Datagrid1 TemplateColumn Table Header information Detail Information
2
6502
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 href="http://www.example.com">DEF</a> <a href="http://www.test.somedomain">ABC</a> If I sort by the default algorithm, I get 'DEF' before 'ABC' because the strings are compared up until they differ after 'www.'. What I would like to do is somehow sort on...
1
1490
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 an action to overload called "SortCommand." In the properties events for your DataGrid, select the "SortCommand" action and implement it with the method name of your choice... But when I go to the datagrid properties events, there is no action...
0
1503
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 buttons to the footer of the table, etc. A datagrid control wont work for me, because I want to have custom buttons images for paging and sorting. Here is one thing I have the most difficulty with: I need a way to have a "master" custom table...
2
3199
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 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/creatingcustomcolumns.asp The problem I am having is that the data in the custom datagridcolumn is not saved to viewstate and after postback, the column does not contain data.
2
2446
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 fine. However, when attempting to assing default values as designtime in the propertygrid, nothing is working on the class object. I know that I am doing it wrong, any ideas what it is? Thanks in advance
0
1168
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 calling base mousedown event. I need to show sorting image (using Datagrid not DatagridView). Please help.
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10049
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9997
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8873
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.