Solved

Updating Data in Controls in a Dialog Box

Posted on 1998-08-03
3
239 Views
Last Modified: 2013-11-19
I have to display some data in different controls such a List Box, List Control, Edit Box in a Dialog. However only partial data is shown i.e when 3 items are to be shown in a List box, only the last one is shown.

However when I click in the two empty spaces in the list box, the data is shown. Any idea how to solve the problem

0
Comment
Question by:kapoorv
[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 Comments
 
LVL 1

Expert Comment

by:guruprasad031298
ID: 1320173
Can you post the code here ....
0
 

Author Comment

by:kapoorv
ID: 1320174

void CTermDialog::OnShowTerm()
{
      // TODO: Add your control notification handler code here

      UpdateData(TRUE);

      vConcat = get_terms((LPCTSTR)m_TermName,(LPCTSTR)m_Language);
      
      // Get the number of Terms with the same name  i.e. having Concat Links.
      if(vConcat.size() == 0)
      {            
            MessageBox("TERM NAME Does Not Exist in Database","TERM NAME ERROR",MB_ICONERROR);
            return;
      }
      else
      if(vConcat.size() == 1)
      {
            for(iConcat = vConcat.begin();iConcat != vConcat.end();++iConcat)
                   Show((*iConcat)->m_term_code);
      }
      else
            MessageBox("TERMS GREATER THAN 1");
}

void CTermDialog::Show(const char* sTermCode)
{
      CTerm      newTerm(sTermCode);
            
      m_Active = newTerm.get_active_ind();            // Get the Active Statue of the Term.
      m_Approval = newTerm.get_approved_ind();      // Get the Approval Indicator of the Term.
      m_Status = newTerm.get_status_ind();            // Get the Statue of the Term.
      
      vNote = newTerm.get_notes();       // Get the Notes associated with the Term.
      int x = 0;
      
      if(vNote.size() > 0)
      {      
            for(iNote = vNote.begin();iNote != vNote.end();++iNote)
            {
                  pNoteType[x] = (*iNote)->m_type;
                  //pNotesText[x]      = (*iNote)->m_text;
                  m_TestNoteType[x]      = (*iNote)->m_type;
                  m_TestNoteText[x]      = (*iNote)->m_text;
                  x++;
            }
      }

      x = 0;
      BOOL bFlag = TRUE;
      m_Notes = m_TestNoteText[0];
      SetDlgItemText(IDC_NOTES,m_Notes);

      while(bFlag)
      {

            switch(*pNoteType[0])
            {
                  case 'S':
                  {
                              m_ScopeNoteButton.SetState(1);
                              bFlag = FALSE;
                              break;
                  }
                  case 'T':
                  {
                              m_MaintainanceNoteButton.SetState(1);
                              bFlag = FALSE;
                              break;
                  }
                  case 'Q':
                        {
                              m_QueryNoteButton.SetState(1);
                              bFlag = FALSE;
                              break;
                        }
                  case 'O':
                        {
                              bFlag = FALSE;
                              break;      
                        }
                  default:
                              return;
            }
      }
            
      // Get the Classes with which the Term is associated.
      m_ClassCtrl.ResetContent(); // Deleting all the Enteries in the Class List Box
      vRmpClass = newTerm.get_classes();
      
      for(iRmpClass = vRmpClass.begin();iRmpClass != vRmpClass.end();++iRmpClass)
      {
            m_ClassDesc = (*iRmpClass)->m_code;
            m_ClassCtrl.AddString(m_ClassDesc);
      }
      
      // Get the Variants of the Term in the Language selected.
/*      iNoOfGridRows = m_VariantGrid->GetNumberRows();
      if(iNoOfGridRows > 1) // Deleting the Rows of the Previous Term
      {
            long i;
            for(i= iNoOfGridRows;i>0;i--)
                  m_VariantGrid->DeleteRow(i);
      }
      
      iNoOfGridRows = iNoOfVariants = 0;
      
      //      vVariant = newTerm.get_variants((LPCTSTR)m_Language);
      vVariant = newTerm.get_variants("NULL");
      for(iVariant = vVariant.begin();iVariant != vVariant.end();++iVariant)
      {
            iNoOfGridRows = m_VariantGrid->GetNumberRows();
            if(iNoOfVariants >= 1) // Adding Rows to the Grid depending on the number
                                             // of Variants for a Term.
                  m_VariantGrid->AppendRow();
            
            sVariantName            = (*iVariant)->m_name;
            sVariantType            = (*iVariant)->m_type;
            sVariantLanguage      = (*iVariant)->m_lang_code;
            
            m_VariantGrid->QuickSetText(0,iNoOfVariants,sVariantType);
            m_VariantGrid->QuickSetText(1,iNoOfVariants,sVariantName);
            m_VariantGrid->QuickSetText(2,iNoOfVariants,sVariantLanguage);
            
            iNoOfVariants++;
      }*/


      vCategory = newTerm.get_categories();       // Get the Category(s) to which the term belongs
      
      CString sCategoryType,sCategoryName;
      m_Category.DeleteAllItems();
      iNoOfVariants = 0;

      for(iCategory = vCategory.begin(); iCategory != vCategory.end();++iCategory)
      {
            sCategoryType = (*iCategory)->m_type;
            sCategoryDesc = (*iCategory)->m_desc;
            sCategoryName = (*iCategory)->m_code;
                              
            m_Category.InsertItem(iNoOfVariants,(LPCTSTR)sCategoryType); // Add the Category Type
            m_Category.SetItemText(iNoOfVariants,1,(LPCTSTR)sCategoryDesc); // Add the Category Type
            m_Category.SetItemText(iNoOfVariants,2,(LPCTSTR)sCategoryName); // Add the Category Name

            iNoOfVariants++;
      }

      m_CreateName = newTerm.get_created_by();
      m_CreateDate = newTerm.get_create_time();
      m_ModifyName = newTerm.get_updated_by();
      m_ModifyDate = newTerm.get_update_time();

      UpdateData(FALSE);
      
}
0
 
LVL 1

Accepted Solution

by:
kumarana earned 50 total points
ID: 1320175
Get the pointers to all your controls and call
InvalidateRect(TRUE) for all of your controls . This might work.
Do this after UpdateData( FALSE );
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

Title # Comments Views Activity
Add content to output file 4 72
while loop over for loop 7 119
countEvens challenge 2 117
sumHeights  challenge 17 83
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

710 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