Solved

ActiveX MSFlexGrid Column Visible

Posted on 1998-06-10
1
383 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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 learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

919 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

15 Experts available now in Live!

Get 1:1 Help Now