Solved

How do I lock Listview column widths/headers?

Posted on 1998-12-08
7
458 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
[X]
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
  • 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

738 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