473,385 Members | 1,693 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,385 software developers and data experts.

Column rearrange in list view

does anyone have a good method or technique for saving the order of columns
that someone rearranged them to and restoring that order on the applications
next load?
Nov 21 '05 #1
3 3241
Using the .NET Framwork 1.x you need to use the Win32 API to get/set the
position of a column since that property is not exposed by .NET.

Using .NET 2.0 you have ColumnHeader.DisplayIndex or similar.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Brian Henry" <no****@nospam.com> escribió en el mensaje
news:%2****************@TK2MSFTNGP14.phx.gbl...
does anyone have a good method or technique for saving the order of
columns that someone rearranged them to and restoring that order on the
applications next load?

Nov 21 '05 #2
I am using .NET 2.0 at the moment, but not sure how to save the states and
restore them properly..
"Carlos J. Quintero [VB MVP]" <ca*****@NOSPAMsogecable.com> wrote in message
news:Om**************@TK2MSFTNGP14.phx.gbl...
Using the .NET Framwork 1.x you need to use the Win32 API to get/set the
position of a column since that property is not exposed by .NET.

Using .NET 2.0 you have ColumnHeader.DisplayIndex or similar.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Brian Henry" <no****@nospam.com> escribió en el mensaje
news:%2****************@TK2MSFTNGP14.phx.gbl...
does anyone have a good method or technique for saving the order of
columns that someone rearranged them to and restoring that order on the
applications next load?


Nov 21 '05 #3
Well, when you close the window, you iterate ListView.Columns to get the
Text and DisplayIndex pairs and you store them somewhere, for example in the
Windows registry
(HKEY_CURRENT_USER\Software\YourCompany\YourApp\Yo urWindow\YourListview).
When you load the window again, you retrieve the pairs and for each column
you set its DisplayIndex...

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Brian Henry" <no****@nospam.com> escribió en el mensaje
news:%2***************@TK2MSFTNGP12.phx.gbl...
I am using .NET 2.0 at the moment, but not sure how to save the states and
restore them properly..


Nov 21 '05 #4

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

Similar topics

0
by: tommazzo | last post by:
I'm currently writing a photo album sotware in C#. I'm using a ListView component to diaplay thumbnail previews of the photos and want to give the user the possibility to rearrange the photos via a...
7
by: Douglas Buchanan | last post by:
I cannot access certain column values of a list box using code. I have a list box 'lstPrv' populated by the query below. SELECT tblPrv.fkPrvID, lkpCat.CatNm, lkpSrv.SrvNm, lkpCat.pkCatID,...
19
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...
10
by: david | last post by:
Hi, all: I need a help from you about DataGrid control. I created a DataGrid, dg, in design view of .NET visual Stadio and use the builder to add a Hyperlink column to dg. I want to try to assign...
9
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...
10
by: JohnR | last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a datagridtablestyle defined. I use the datagridtablestyle to change the order of the columns (so they can be different than...
0
by: fasan | last post by:
Hi Everyone I need help deperately. In vb 6 the was a way to have a tree list with multi columns. But not in the tree. Its kind of hard to explain. Its like there was a bunch of columns at the...
3
by: Beowulf | last post by:
I was just messing around with some ad hoc views and table returning UDFs today so I could look at and print out data from a small table and noticed something strange. If I stick my select...
4
by: Lou O | last post by:
Is it possible to use the row (index) of a list box as control source Property for a text box? Example: Text1.ControlSource Property is set to "= List1.Column(0,2)" in design view. When I open...
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:
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.