Solved

ActiveX MSFlexGrid Column Visible

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

Industry Leaders: 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

Title # Comments Views Activity
mixing C++ & C# in Vis Studio 2013 7 239
Writing a parser for java language 4 93
How to print into std::string like sprintf using C++11? 12 122
learn programming 8 72
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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

726 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