Solved

ActiveX MSFlexGrid Column Visible

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Title # Comments Views Activity
Quicksort a dynamic deque 33 73
PDF library for Delphi 2 128
Embarcadero C++ Builder XE2 TDateTime 8 75
Are the two lines the same? If not what is the difference? 2 22
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…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

809 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