Solved

ActiveX MSFlexGrid Column Visible

Posted on 1998-06-10
1
378 Views
Last Modified: 2008-02-26
The ActiveX control MSFlexGrid has a function called
GetColIsVisible().  I could not find a SetColIsVisible().  How
can I show or hide a specific column on the grid?
0
Comment
Question by:jrmcg
1 Comment
 
LVL 1

Accepted Solution

by:
guruprasad031298 earned 50 total points
ID: 1165588
Even I couldn't find a similar method. So, what I did is to make the desired column width as 0, so that the next column will overlap the "to be" hidden column. Here is a code snippet.

/** If the selected paint scheme is Monotone, don't display the secondary paint code
 * and description  */
CString comboSel;
m_PaintProcCombo.GetWindowText (comboSel);
if (comboSel.CompareNoCase (MONOTONE_PAINT) == 0)
{
    // Hide secondary code and desc columns
   glSecondaryCodeWidth = m_PaintTrimGrid.GetColWidth (5);
   glSecondaryDescWidth = m_PaintTrimGrid.GetColWidth (6);

   // concentrate here
   m_PaintTrimGrid.SetColWidth (5, 0);
   m_PaintTrimGrid.SetColWidth(6, 0);
   m_PaintTrimGrid.Refresh();
}
else
{
   // need to note this too ....
   if (glSecondaryCodeWidth != 0)
      m_PaintTrimGrid.SetColWidth (5, glSecondaryCodeWidth);
   if (glSecondaryDescWidth != 0)
              m_PaintTrimGrid.SetColWidth (6, glSecondaryDescWidth);
   m_PaintTrimGrid.Refresh();
}

Discard the logic and look for whatever you are looking for. Here glSecondaryCodeWidth is a global variable with the module as it's scope. Eventhough you can't digest this sloppy code, it works and it works WELL.

Hope this helps ....
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

707 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now