Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How do I lock Listview column widths/headers?

Posted on 1998-12-08
7
456 Views
Last Modified: 2013-12-25
Damned if I can find it. I want to prevent the user from resizing column headers when a listview's in report view. This is because I use zero width columns to hold reference data (eg. customer primary key) and the user can access this by simply playing with the column widths. I want the listview to basically ignore user attempts to modify the column width. Help!
0
Comment
Question by:deal051298
  • 3
  • 3
7 Comments
 

Author Comment

by:deal051298
ID: 1488808
Edited text of question
0
 
LVL 7

Expert Comment

by:Inteqam
ID: 1488809
you can use a tricky way , by making the style of the listview  [ listview.view=2 ] is list, and use labels instead od headers.


0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1488810
A better solution for the 0 length columns is to use the tag property of Listitem object with a variant array

Dim x as string(4)
Dim li as listitem
x(1) = "Hello"
x(2) = "Othervalue"
.
li.tag = x


0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 13

Expert Comment

by:Mirkwood
ID: 1488811
I couldnot find any easy method to lock them.
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 200 total points
ID: 1488812
A better solution for the 0 length columns is to use the tag property of Listitem object with a variant array

Dim x as string(4)
Dim li as listitem
x(1) = "Hello"
x(2) = "Othervalue"
 
li.tag = x

0
 

Author Comment

by:deal051298
ID: 1488813
Thanks Mirkwood! Has been implemented. Still would like to lock the column headers but your quick response meant I could get on with this under a tight deadline! And it solves my "user seeing data they're not supposed to" problem!
0
 

Author Comment

by:deal051298
ID: 1488814
For future reference it should be noted that the syntax for the array I used was:
dim x(0 to 3) as variant //can be (3 to 30),(1 to 4) or whatever

the syntax Mirkwood gave me was incorrect. Also to retrieve the tag just use:

(whatever here).tag(1) //or 0,2,3 as the array permits
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question