Professional UI Solutions
Site Map   /  Register


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 » Refresh Cell Text? Collapse All
Subject Author Date
Gavin Weeks Jan 21, 2010 - 8:48 AM

I am overriding OnGbwAnalyzeCellMouseClickEvent to catch a double click event, to copy the text from one cell to another cell, I am using TextGet after the hit test to get the value of the cell then I am trying to use TextSet to try to set the text in another cell, works fine when I running through it in debug and the grid is not displayed then re-displayed, what should I be using? is there a refresh for the cell data? Or should I be doing it some other way?


CExtGridCell * pCell = this->GridCellGet(htInfo.m_nColNo,htInfo.m_nRowNo,0,0,RUNTIME_CLASS(CExtGridCellStringDM ));

CString value;
pCell = this->GridCellGet(CORRELATE_COL,htInfo.m_nRowNo,0,0,RUNTIME_CLASS(CExtGridCellStringDM ));

Technical Support Jan 21, 2010 - 1:43 PM

The CExtGridBaseWnd::FocusGet() method returns the focused cell location. The full row selection grids use only row number (CPoint::y) and column number (CPoint::x) is ignored. The vice versa approach is applied for the full column selection grids. The negative row/column numbers mean there is no focused cell/column/row in the grid control. The CExtGridBaseWnd::FocusUnset() method unsets the focus from the currently focused cell. The CExtGridBaseWnd::FocusSet() method allows you to set focus to row and/or column and optionally scroll to this row/column and reset selection to them. You may also need to get client coordinates of the grid cell by its row/column indices. This may be needed for repainting some grid cell(s). The grid control can return client coordinates only for the grid cells which are visible in its client area. Here is how to compute the cell rectangle and redraw the cell:

CExtGridWnd & wndGrid = . . .
LONG nColNo = . . .
LONG nRowNo = . . .
INT nColType = . . .
INT nRowType = . . .
CRect rcInvalidate;
            if(         wndGrid.GridCellRectsGet(
                        wndGrid.InvalidateRect( &rcInvalidate );

Gavin Weeks Jan 21, 2010 - 11:39 AM

Got it FocusUnset(); seems to work.

Gavin Weeks Jan 21, 2010 - 8:58 AM

Seems to also update fine, when I change focus to another cell.