473,671 Members | 2,285 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Re: Listview Column Header AutoSize & column sorting

On 29/08/2008 in message
<F5************ *************** *******@microso ft.comEd Kramer wrote:
>I like being able to create my own listviewitemsor ter and use it, but
shouldn't there be a built in way to sort?
There is a crude in-built sorter which will sort column 1 either ascending
or descending - turn it on with the sorting property.

You are much better off rolling your own to take account of the different
data types the LV may contain, you can also use it to set the sort icons.

--
Jeff Gaines Damerham Hampshire UK
It may be that your sole purpose in life is to serve as a warning to others.
Aug 29 '08 #1
0 1109

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

Similar topics

0
1737
by: rmorvay | last post by:
I have successfully integrated sorting in the listview control with the following code: Private Sub ListView_ColumnClick(ByVal sender As Object, ByVal e As System.Windows.Forms.ColumnClickEventArgs) Handles ListView.ColumnClick If ListView.Sorting = System.Windows.Forms.SortOrder.Ascending Then ListView.Sorting = System.Windows.Forms.SortOrder.Descending Else ListView.Sorting = System.Windows.Forms.SortOrder.Ascending
1
7357
by: Cybertof | last post by:
Hello, Do you know why in the following code the result is a column of size 0 ? (in the doc it says to use -2 to autosize column header...) ColumnHeader MyColumnHeader = new ColumnHeader(); MyColumnHeader.Text = "col1"; MyColumnHeader.Width = -2; // if you remove this line col appears MyListView.Columns.Add(MyColumnHeader);
0
1217
by: Abhishek | last post by:
Hi! I am using listview control having 4 columns. I want it to behave in a similar manner as the details view of windows explorer. i.e it should sort on all the columns and all the columns should have the functionality to move horizontally (horizontal order of the columns) for this I am using Listview class . I reffred to MSDN and included a class which implements the System.Collections.IComparer interface that performs the ListViewItem
19
25452
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to sort columns based on the column header the user has clicked in both Ascending and Descending formats.
9
10368
by: Kevin Westhead | last post by:
Can anyone confirm whether or not there are any limits imposed on the widths of autosized columns in a list-view. I've found that the autosizing appears to have an upper limit, i.e. it will not expand beyond some (unknown) maximum length. This applies to user-autosizing (double-clicking the divider) and code-autosizing using LVSCW_AUTOSIZE. For example, create a new project and place a ListView (VB5 version) and CommandButton on a form...
12
3107
by: Dennis | last post by:
I have a form which has a ListView control named ListView1 added at design time. When I add items using the following code, they don't appear in the list view. However, if I create a ListView control in code and add it to the form, it works. Why don't the items show up in the ListView that I added at desgn time. ' Create three items and three sets of subitems for each item. Dim item1 As New ListViewItem("item1", 0) ' Place a check...
2
7221
by: jediknight | last post by:
Hi, I have a listview which has columns of text and columns of numerical data. I need to be able to sort these columns into ascending/desending order whenever the user clicks on the column header. The text columns are sorted correctly but the numerical columns seem not to get sorted properly. For example I get the following result when I try to sort a numerical
11
9986
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 ?
3
2256
by: --== Alain ==-- | last post by:
Hi, I have some little issue when i want to redraw the columnHeader of my ListView. Basically i display a little arrow to show the sortOrder of each column. For sure only the clicked column is sorted. here is my code located in OnDrawColumnHeader overriden method: .... if(e->ColumnIndex == this->m_LastClickedColumn)
0
8392
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
8819
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
8597
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
8669
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...
1
6222
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
5692
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
4222
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...
2
2049
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1807
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.