Solved

Hiding columns in a flexgrid

Posted on 2000-05-01
6
347 Views
Last Modified: 2010-05-02
Is there a way to hide columns in a flexgrid?  
0
Comment
Question by:DebeG
[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
  • 2
6 Comments
 
LVL 6

Expert Comment

by:Marine
ID: 2765974
yes the best way as someone put it is the easiest way is to set its width to 0
flexgrid1.colwidth(1) = 0
0
 
LVL 12

Accepted Solution

by:
mark2150 earned 50 total points
ID: 2766009
Don't hide columns. That's resource wasteful and sloppy coding.

Only populate the columns you need. Change your SELECT * FROM .. into SELECT {field list} FROM ...

If you need to have an array of data from the data source but you don't want the user to see it then declare a separate array to hold the data. This will keep the data with a shared index but will reduce the overhead as the array doesn't have the list of properties to manage. Using "invisible" columns also serves to obscure the function being performed.

M
0
 

Author Comment

by:DebeG
ID: 2778920
Marine - I had already adjusted my column width to 0 before I posted the question.  I guess I just thought there was another way to do this.  

Mark2150 - Thanks for the advice.  I am just learning and do not know all the 'correct' ways of doing things yet.  I appreciate constructive criticism.  It helps to make me a better programmer, i think.  Actually, in another language (Synon on AS400) it would have been perfectly fine to hide a field on a screen for later use.  Just idiosyncrasies of different languages, i guess. I will award the points to you if you post your response as an answer.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Expert Comment

by:mark2150
ID: 2779007
Thank you for the positive feedback. While making the column 0 width *does* work, I do feel, having had to maintain code that does stuff like that, that my way does work better.

If you're interested I have a "white paper" on VB style on my corporate web page. Visit www.netexperts.cc and go down to the bottom.

There is no need to post as answer as you can use the "Accept comment as answer" button on any response.

M
0
 

Author Comment

by:DebeG
ID: 2780497
The white paper is printing out now.  Thanks again.  Sorry I didn't see the accept comment as answer button.  
0
 
LVL 12

Expert Comment

by:mark2150
ID: 2780533
No problem. Always glad to help in either VB or how to use EE! :-)

M
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

740 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