Results 1 to 1 of 1

Thread: if ComboBox is selected, click in different cell, comboBox shows different cell value

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    1

    if ComboBox is selected, click in different cell, comboBox shows different cell value

    Initially grid is all CGXEditControl's.
    //Registered controls
    //Static Edit Box
    CGXEditControl* pEditControl = new CGXEditControl(GetParam()->Grid(), GX_IDS_CTRL_EDIT);
    ((CGXStatic*)pEditControl)->ImplementCellTips();
    RegisterControl(GX_IDS_CTRL_EDIT, pEditControl);

    //Combo Box
    CGXComboBoxWnd* pNamedSetComboBox = new CGXComboBoxWnd(GetParam()->Grid());
    pNamedSetComboBox->Create(WS_VSCROLL | CBS_DROPDOWNLIST, GX_IDS_CTRL_CBS_DROPDOWNLIST);
    pNamedSetComboBox->m_bFillWithChoiceList = TRUE;
    pNamedSetComboBox->m_bWantArrowKeys = FALSE;
    pNamedSetComboBox->m_nIndexValue = 0;
    pNamedSetComboBox->m_bDispChoice = TRUE;
    pNamedSetComboBox->m_bInactiveDrawButton = TRUE; //Track# 80049 - show drop-down arrow for combo boxes
    RegisterControl(GX_IDS_CTRL_CBS_DROPDOWNLIST, pNamedSetComboBox);
    ((CGXStatic*)pNamedSetComboBox)->ImplementCellTips();

    In OnStartEditing if data is a list then control is changed to
    SetStyleRange( CGXRange(nRow, nCol),
    CGXStyle()
    .SetControl(GX_IDS_CTRL_CBS_DROPDOWNLIST)
    .SetWrapText(TRUE)
    .SetHorizontalAlignment(DT_LEFT)
    .SetChoiceList(strChoiceList) // list of "NamedSet ValueNames"
    .SetUserAttributePtr(GX_IDS_UA_ELLIPSISTYPE, new CGXEllipseUserAttribute(gxDotEllipse))
    .SetValue(uInitialValue) // selected "NamedSet ValueIndex", list is zero-based, "0", "1", "2", ...
    .SetUserAttribute(GX_IDS_UA_TOOLTIPTEXT, strCell) ); // selected "NamedSet ValueName"

    In OnEndEditing if control is ComboBox then control is changed back to
    SetStyleRange( CGXRange(nRow, nCol), CGXStyle()
    .SetControl(GX_IDS_CTRL_EDIT)
    .SetWrapText(FALSE)
    .SetHorizontalAlignment(DT_LEFT)
    .SetUserAttributePtr(GX_IDS_UA_ELLIPSISTYPE, new CGXEllipseUserAttribute(gxDotEllipse))
    .SetValue(strSelectedText) // Selected "NamedSet ValueName"
    .SetUserAttribute(GX_IDS_UA_TOOLTIPTEXT, strSelectedText) ); // Selected "NamedSet ValueName"

    But, if a ComboBox is selected and the user clicks in different cell then the ComboBox shows different cell's value.

    See pictures in my album "CGXComboBoxWnd Click problem".

    We are using Objective Grid 13.0.1, Visual Studio 2012, Windows 7.
    Last edited by mikecb; 02-04-2014 at 12:23 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •