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 » CExtReportGridWnd problem Collapse All
Subject Author Date
Konstantin Matveev Jun 1, 2006 - 8:39 AM

Hi,
I have a several questions:
1) When i want to remove all rows from my report grid derived from CExtReportGridWnd class, program causes an exception. I use Prof-UIS V2.54
Call stack:
>    mfc71d.dll!CWnd::put_accName(tagVARIANT varChild={...}, wchar_t * szName=0x00000001) Line 3862 + 0x1c    C++
    ProfUIS254md.dll!CExtTreeGridDataProvider::_Tree_MapRowToCache(unsigned long nRowNo=0) Line 1158 + 0x12    C++
    ProfUIS254md.dll!CExtTreeGridDataProvider::_Tree_NodeGetByVisibleRowIndex(unsigned long nRowNo=1) Line 642 + 0x14    C++
    ProfUIS254md.dll!CExtTreeGridDataProvider::TreeNodeGetByVisibleRowIndex(unsigned long nRowNo=1) Line 627 + 0x14    C++
    ProfUIS254md.dll!CExtTreeGridWnd::ItemGetByVisibleRowIndex(long nRowNo=1) Line 1928 + 0xc    C++
    ProfUIS254md.dll!CExtTreeGridWnd::OnSiwQueryItemExtentV(long nRowNo=0, int * p_nExtraSpaceBefore=0x00000000, int * p_nExtraSpaceAfter=0x00000000) Line 3100 + 0x14    C++
    ProfUIS254md.dll!CExtGridBaseWnd::OnSiwCalcPageMetrics(int nDirection=0) Line 5124 + 0x1b    C++
    ProfUIS254md.dll!CExtScrollItemWnd::OnSiwGetVisibleRange() Line 4945 + 0x16    C++
    ProfUIS254md.dll!CExtScrollItemWnd::OnSwUpdateScrollBars() Line 3608 + 0x1b    C++
    ProfUIS254md.dll!CExtGridBaseWnd::OnSwUpdateScrollBars() Line 10368    C++
    ProfUIS254md.dll!CExtReportGridWnd::OnSwUpdateScrollBars() Line 5638    C++
    ProfUIS254md.dll!CExtGridBaseWnd::RowRemove(long nRowNo=0, long nRowRemoveCount=76, bool bRedraw=true) Line 1377 + 0x10    C++
    ProfUIS254md.dll!CExtGridWnd::RowRemove(long nRowNo=0, long nRowRemoveCount=76, bool bRedraw=true) Line 42869 + 0x14    C++
    ProfUIS254md.dll!CExtGridBaseWnd::RowTruncate(long nRowNo=0, bool bRedraw=true) Line 446 + 0x1a    C++
    ProfUIS254md.dll!CExtGridBaseWnd::RowRemoveAll(bool bRedraw=true) Line 453    C++
How can I solve this trouble?

2) My grid control has checkboxes inside. How can I catch events like "check" and "uncheck" in my class derived from CExtReportGridWnd ? I have tried to reload
virtual void OnGridCellSetCheck();
virtual void OnGridCellInputComplete();
virtual bool OnGridCellButtonPressed();
but had no results.

Technical Support Jun 2, 2006 - 7:03 AM

The CExtGridWnd::RowRemove() and CExtGridWnd::RowRemoveAll() methods should not be used with the CExtReportGridWnd class. If you want to remove all the report grid items (rows), please use the following code:

CExtReportGridWnd * pReportGrid = . . .
LONG nColCount = pReportGrid->ColumnCountGet();
LONG nRowCount = pReportGrid->RowCountGet();
       if( nRowCount == 0 || nColCount == 0 )
              return;
       pReportGrid->SelectionUnset( false, false );
       pReportGrid->SelectionInsertAt( 0, CRect( 0, 0, nColCount - 1, nRowCount - 1 ), false );
       pReportGrid->ReportItemUnRegisterSelection();
You can remove a particular report grid item with the code below:
CExtReportGridWnd * pReportGrid = . . .
CExtReportGridItem * pRGI = . . .
              VERIFY( pReportGrid->ReportItemUnRegister( pRGI ) );