473,756 Members | 3,111 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Sort in ListView

Hai Friends,
I'm using ListView to load and show the data. When use the Sorting Property, the grid is sorted based on the First Column. It is omitting all others.It's giving both Ascending and Descending
If I want to sort based on the Second or any other columns, I'm using the ListViewItemCom parer class. But the sorting is done only by Ascending. I need to sort it by Descding too. Please help me friends, to sort both IN Ascending and Descding Order based on the Columns clicked in the ListView.

Thanks

Nov 20 '05 #1
1 1265
* =?Utf-8?B?VmVua2F0YXJ hamFu?= <Ve**********@d iscussions.micr osoft.com> scripsit:
If I want to sort based on the Second or any other columns, I'm
using the ListViewItemCom parer class. But the sorting is done only by
Ascending. I need to sort it by Descding too. Please help me friends, to
sort both IN Ascending and Descding Order based on the Columns clicked
in the ListView.


You will find some samples here (C#):

<URL:http://www.codeproject .com/cs/miscctrl/#ListView+contr ols>

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1892
by: jrhoads23 | last post by:
Hello, I subclassed my own ListView which supports column sorting. It automatically draws the up/down sort arrows in the column header. The arrows that are used are drawn by me. I noticed that Windows XP systems uses different sort arrows than Windows 2000 and earlier systems. (open Windows Explorer and check them out on the two differnt O/S) I would like my ListView to use the same arrows as the operating system uses. Is there an API...
3
5894
by: Steve | last post by:
I have windows form with ListView control. The ListView control has few columns which user can sort by clicking the column header. I want the column header have the small triangle indicator of sort order. How can I implement that? Thanks
1
1465
by: perspolis | last post by:
hi all I used a listview with RightToLeft property enabled. I have 2 questions 1-how can I show icon in right side of listview not let side? 2-I want to sort listview by clicking on it's columns..,how can I? thx in advance.
1
15019
by: neelu | last post by:
I have four columns in listview. SR Number Part# DES Qty Weight 59 9410106800 Nut 10 0.03 60 90304ge800 Helmet 5 0.325 61 9635439604 Cap 15 0.421 62 25340h1245 Shoes 2 0.001 I want that when I click on column part# it sort the list View
4
18209
by: Robin Tucker | last post by:
How do I sort the items in a list box? I am using a class derived from IComparer to sort items on columns in a ListView, but the ListBox doesn't support this kind of facility. The "items" in my list box aren't just strings, they are a class I have defined for each list item. There is a comparitor function, but how can I write - ListBox.Items.Sort() in this instance? Do I need to do my own quicksort?
1
1259
by: Jean-Claude Bertrand | last post by:
Hi! Windows of the application IO have to built (my first one in vb.Net) is made from 2 part: a) A grid wich will be used only to display the main information of the current record (so the grid must select the entire row and not allow editing). I have selected the datagrid so far and succed after many research to allow only entire row selection with this help http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q792q
0
1049
by: Frank Rizzo | last post by:
I've implemented sort via the well known method of assigning the an IComparer class to the .ListViewItemSorter property. It works fine except for one thing. If I had rearranged the column order in the listview and then sort the column, the listview control returns the column order to its original state. How can I tell it not to? Thanks Frank
0
1780
by: Terry Brown | last post by:
I have a form which contains a listview item. The form is created to view data that is generated by interaction with a separate form. There are buttons on the form that change the data source that is displayed in the listview. The listview can be sorted by clicking on columns in the listview. When I change the data for the listview I use listview1.Clear() to clear the listview, then rebuild the listview by adding the proper columns...
11
9997
by: Alan T | last post by:
Does the ListView supports sort? I want to have a up/down arrow/triangle that show it is sorted asc or desc on the column headers when I click the column header. May be I need a third-party components ?
0
9325
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
9152
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9716
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...
0
9571
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8569
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...
0
4996
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...
0
5180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3676
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
2
3185
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.