Solved

Updating Data in Controls in a Dialog Box

Posted on 1998-08-03
3
240 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

Myth Busting: MongoDB Scalability (it scales!)

I was talking with one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. He mentioned to me that several customers have been telling him that “MongoDB doesn’t scale!” MongoDB’s scalability was in question?

My response was, “Is that a joke?"

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

632 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