473,386 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Listview AllowColumnReorder

J M
When you set the Listview's property AllowColumnReorder to True, users can
reorder the columns (quite logical I guess)... Bus how on earth can I obtain
from code what order these columns are in??? I want to save these settings
(to the registry or to a file) so that the program can recall which order of
columns the user prefers....
Thanks
J Mous
Nov 20 '05 #1
3 2208
Hi JM,

You cannot sort columnS, only the first column can be sorted, for more
columns you have to make your own class using Icomparer.

http://msdn.microsoft.com/library/de...ssorttopic.asp

With this is should in my idea also be possible to know what is the sort
order of a column, however I think that that is a lot of work.

I hope this helps?

Cor
When you set the Listview's property AllowColumnReorder to True, users can
reorder the columns (quite logical I guess)... Bus how on earth can I obtain from code what order these columns are in??? I want to save these settings
(to the registry or to a file) so that the program can recall which order of columns the user prefers....
Thanks
J Mous

Nov 20 '05 #2
J M
I think i didn't explain it right.

I want to get the order of the column headers, not the data itself in te
listview...

If I take windows explorer as an example,
you have the columns, filename, filetype, filesize, and so on and so on....
But, let's say for whatever reason I want to see the filesize as the first
column...
So I drag te column to the left and it is moved there. So now you've got:
filsize, filename, filetype, ..., ...

Sorting data in the columns by whatever column, I've already worked out...

"Cor Ligthert" <no**********@planet.nl> schreef in bericht
news:Od**************@TK2MSFTNGP10.phx.gbl...
Hi JM,

You cannot sort columnS, only the first column can be sorted, for more
columns you have to make your own class using Icomparer.

http://msdn.microsoft.com/library/de...ssorttopic.asp
With this is should in my idea also be possible to know what is the sort
order of a column, however I think that that is a lot of work.

I hope this helps?

Cor
When you set the Listview's property AllowColumnReorder to True, users can reorder the columns (quite logical I guess)... Bus how on earth can I obtain
from code what order these columns are in??? I want to save these settings (to the registry or to a file) so that the program can recall which

order of
columns the user prefers....
Thanks
J Mous


Nov 20 '05 #3
You'll have to send a LVM_GETCOLUMNORDERARRAY
message to the listview

Try these threads:
http://groups.google.se/groups?as_q=...=UTF-8&as_ugro
up=*dotnet*&lr=&hl=sv

/claes
"J M" <a@b.com> wrote in message
news:Oz*************@tk2msftngp13.phx.gbl...
When you set the Listview's property AllowColumnReorder to True, users can
reorder the columns (quite logical I guess)... Bus how on earth can I obtain from code what order these columns are in??? I want to save these settings
(to the registry or to a file) so that the program can recall which order of columns the user prefers....
Thanks
J Mous

Nov 20 '05 #4

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

Similar topics

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: Scott Kay | last post by:
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...
1
by: Mamatha | last post by:
Hi I have one application ,that diplays data from database into the listview control.While adding data to the listview i want to display an icon to the leftside of the first column's data.Here...
0
by: Jon | last post by:
I am using the AllowColumnReorder property on the listview for my users' convenience...however I need to know what's the recommended method for saving that column order (In VB 6 I saved the order...
4
by: Steph. | last post by:
I have a List view displaying data in Detail mode with several columns. How I can get the column index the user clicked on ? (when user click on an item inside the ListView, not on a column...
1
by: Joe | last post by:
I set up two columns in listview. I use Add to add items, but how do I access the second column? and add text?
2
by: mrmagoo | last post by:
I'm trying to fill a listview with data. I'm using the example from the help file, but how do I modify this to avoid using images? I want the exact same layout but without images. This procedure...
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...
3
by: uday1302 | last post by:
Hi All, I have tried by seeing an example. See the below code. Here I have a Problem. Treeview has already one root node and twochild nodes with it. They have to be dragged and dropped in listview....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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...

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.