Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtTreeGridWnd with 2 different outer rows at the top Collapse All
Subject Author Date
Thomas Aust Mar 7, 2006 - 3:14 AM

Is there any possibility to create 2 different outer rows at the top in a CExtTreeGridWnd?
When I use
OuterRowCountTopSet(2, false);
and then create the cells with GridCellGetOuterAtTop in the first row I get 2 identical rows...

Technical Support Mar 7, 2006 - 7:08 AM

Please make sure that you correctly retrieved the cell objects. You need to use the GridCellGetOuterAtTop method in the following way:

CExtGridCellHeader * pCell =
 STATIC_DOWNCAST(
  CExtGridCellHeader,
  m_wndGrid.GridCellGetOuterAtTop(
   nColNo,
   nRowNo,
   RUNTIME_CLASS(CExtGridCellHeader)
   )
  );
In the SimpleGrids sample there is a Cell Data Aligning page with two outer rows.

Thomas Aust Mar 7, 2006 - 3:05 PM

Sorry, i used it in the way you discribed:

void CTreeGridEx::InitGridLayout()
{
    g_PaintManager->LoadWinXpTreeBox(m_iconTreeBoxExpanded,    true);
    g_PaintManager->LoadWinXpTreeBox(m_iconTreeBoxCollapsed, false);

    SiwModifyStyle(__ESIS_STH_PIXEL|
         __ESIS_STV_ITEM|
         __EGBS_SFB_CELLS|
         __EGBS_NO_HIDE_SELECTION|
         __EGBS_GRIDLINES|
         __EGBS_RESIZING_CELLS_OUTER|
         __EGBS_DYNAMIC_RESIZING_H,
         0, false);

    SiwModifyStyleEx(__EGBS_EX_HVI_EVENT_CELLS|
         __EGBS_EX_CELL_TOOLTIPS_OUTER|
         __EGBS_EX_CELL_EXPANDING_INNER|
         __EGWS_EX_PM_COLORS,
         0, false);

    BseModifyStyle(__EGWS_BSE_BUTTONS_PERSISTENT|
         __EGWS_BSE_EDIT_CELLS_INNER|
         __EGWS_BSE_EDIT_DOUBLE_LCLICK|
//         __EGWS_BSE_EDIT_SINGLE_LCLICK|
         __EGWS_BSE_EDIT_SINGLE_FOCUSED_ONLY|
         __EGWS_BSE_EDIT_RETURN_CLICK|
         __EGWS_BSE_WALK_VERT,
         __EGWS_BSE_DEFAULT|
         __EGWS_BSE_SORT_COLUMNS,
         false);

    RowRemoveAll(false);
    ColumnRemoveAll(false);
    ColumnAdd(colAll, false);

    OuterRowCountTopSet(1L, false);
    CExtGridCellHeader * pCell;

pCell = STATIC_DOWNCAST(CExtGridCellHeader , GridCellGetOuterAtTop(colPos, 0L, RUNTIME_CLASS(CExtGridCellHeader )));
    pCell->ExtentSet(100, -1);
    pCell->ExtentSet(100, 0);
    pCell->ExtentSet(100, 1);
//    pCell->SetIndex(colPos);

    pCell = STATIC_DOWNCAST(CExtGridCellHeader , GridCellGetOuterAtTop(colTxt, 0L, RUNTIME_CLASS(CExtGridCellHeader )));
    pCell->ExtentSet(340);
//    pCell->SetIndex(colTxt);

    pCell = STATIC_DOWNCAST(CExtGridCellHeader , GridCellGetOuterAtTop(colMount, 0L, RUNTIME_CLASS(CExtGridCellHeader )));
    pCell->ExtentSet(90);
//    pCell->SetIndex(colMount);
    pCell->TextSet(_T("Menge "));
    pCell->ModifyStyle(__EGCS_TA_HORZ_RIGHT);

    pCell = STATIC_DOWNCAST(CExtGridCellHeader , GridCellGetOuterAtTop(colUnit, 0L, RUNTIME_CLASS(CExtGridCellHeader )));
    pCell->ExtentSet(45);
//    pCell->SetIndex(colUnit);
    pCell->TextSet(_T(" Einh."));

    pCell = STATIC_DOWNCAST(CExtGridCellHeader , GridCellGetOuterAtTop(colEP, 0L, RUNTIME_CLASS(CExtGridCellHeader )));
    pCell->ExtentSet(90);
//    pCell->SetIndex(colEP);
    pCell->TextSet(_T("EP"));
    pCell->ModifyStyle(__EGCS_TA_HORZ_RIGHT);

    pCell = STATIC_DOWNCAST(CExtGridCellHeader , GridCellGetOuterAtTop(colSum, 0L, RUNTIME_CLASS(CExtGridCellHeader )));
    pCell->ExtentSet(110);
//    pCell->SetIndex(colSum);
    pCell->TextSet(_T("Summe"));
    pCell->ModifyStyle(__EGCS_TA_HORZ_RIGHT);

pCell = STATIC_DOWNCAST(CExtGridCellHeader , GridCellGetOuterAtTop(colPos, 1L, RUNTIME_CLASS(CExtGridCellHeader )));
    pCell = STATIC_DOWNCAST(CExtGridCellHeader , GridCellGetOuterAtTop(colTxt, 1L, RUNTIME_CLASS(CExtGridCellHeader )));
    pCell = STATIC_DOWNCAST(CExtGridCellHeader , GridCellGetOuterAtTop(colMount, 1L, RUNTIME_CLASS(CExtGridCellHeader )));
    pCell = STATIC_DOWNCAST(CExtGridCellHeader , GridCellGetOuterAtTop(colUnit, 1L, RUNTIME_CLASS(CExtGridCellHeader )));
    pCell = STATIC_DOWNCAST(CExtGridCellHeader , GridCellGetOuterAtTop(colEP, 1L, RUNTIME_CLASS(CExtGridCellHeader )));
    pCell = STATIC_DOWNCAST(CExtGridCellHeader , GridCellGetOuterAtTop(colSum, 1L, RUNTIME_CLASS(CExtGridCellHeader )));

    OuterRowHeightSet(true, 0, 20);
}

The result are 2 indentical rows include the Text...

Technical Support Mar 9, 2006 - 9:49 AM

You said that you are using two outer rows, but in your code you set only one outer row:

OuterRowCountTopSet(1L, false);