473,474 Members | 1,614 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Reorder ListView Columns

Hi,

When I use the AllowColumnReorder in the ListView Control, this allows the
user to reorder
columns by dragging them around. Any items added to the control after the
user has reordered them
appear in the correct column (this is good). Is there any way to determine
what the original ordinal
position of the column was before it was reordered?

I tried looking at the Index property of the ColumnHeader but it returns the
order in which the columns appear
not the original column number.

To rehash:

The user is presented with at listview in detail style:
Name - Address - Phone Number
(1) (2) (3)

He then, since AllowColumnReorder is on drags Address to the right of Phone
Number and sees rows now ordered as
Name - Phone Number - Address
(1) (3) (2)

Columns added after this are displayed correctly even though the subitems
are arranged in the orignal order.
Is there any way to determine the original column number?
Is there any way to determine how the columns are remapped?

Thanks,
Scott Kay
Nov 16 '05 #1
1 5178
The columns stay at their original ordering in the Columns collection. Its
new order you need to find.

Ciaran
"Scott Kay" <By*****@nospam.nospam> wrote in message
news:uF**************@TK2MSFTNGP15.phx.gbl...
Hi,

When I use the AllowColumnReorder in the ListView Control, this allows the
user to reorder
columns by dragging them around. Any items added to the control after the
user has reordered them
appear in the correct column (this is good). Is there any way to
determine what the original ordinal
position of the column was before it was reordered?

I tried looking at the Index property of the ColumnHeader but it returns
the order in which the columns appear
not the original column number.

To rehash:

The user is presented with at listview in detail style:
Name - Address - Phone Number
(1) (2) (3)

He then, since AllowColumnReorder is on drags Address to the right of
Phone Number and sees rows now ordered as
Name - Phone Number - Address
(1) (3) (2)

Columns added after this are displayed correctly even though the subitems
are arranged in the orignal order.
Is there any way to determine the original column number?
Is there any way to determine how the columns are remapped?

Thanks,
Scott Kay

Nov 16 '05 #2

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

Similar topics

6
by: VM | last post by:
How can I fill up a listview with text file contents? My listview has two columns and the first column fills up with a while loop: while (myString != null) { myString = sr.Readline();...
1
by: Travis | last post by:
I have set AllowColumnReorder to true and turned off AutoArrange but when I load a list view with data I still cannot get it to order the columns no matter which column I click on. Help
1
by: Mat | last post by:
Reordering Column changes column Indexes???? i use column.index to access(or add ) data in listview. i want to allow user to reorder columns as they need. So i am afraid to get wrong data when user...
7
by: BobAchgill | last post by:
I am trying to decide which of these controls to use to implement letting my user select a full row from MyList. The MyList has several columns which would be nice to sort by at run time. The...
12
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...
0
by: uv507 | last post by:
Hello, I have found a way to easily reorder rows of my listview. But it only works in small icons mode. When I do my reordering (drag and drop in my own list) in large icons mode, the item that...
0
by: JR | last post by:
hi, I have sorted listview with click on the columnheaders. Works fine I can reorder my columns. when I do the columns aren't in order anymore anyone an idee to solve this Jan
1
by: samoore33 | last post by:
I found this code on MSDN, and it works great. It creates a ListView dynamically and add items to it and all. It is great. I have changed a few of the column names to suit me. Dim listView1 As...
0
by: daju | last post by:
hello My question is, after we allow the column reorder can we modify the order of columns through our code. What I need to do is reorder the listview columns so the first column with the...
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...
1
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
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,...
1
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
1
muto222
php
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.