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 » ReportGrid: problems with ItemExpand after update 2.80->2.82 Collapse All
Subject Author Date
Martin Baumgaertner Jan 17, 2008 - 7:55 AM

Dear ProfUIS-Team,

after having updated from v2.80 to v2.82 an assertion occurs in my application when calling ItemExpand like this:

void
CItemBrowser::FocusAndSelectItem (
	const HTREEITEM hTreeItem
	)
{
	ItemExpand( hTreeItem, TVE_EXPAND ); // ##### assertion #######
	VERIFY( ReportSortOrderUpdate( false ) );

	LONG nRowNo = ItemGetVisibleIndexOf( hTreeItem );
	if ( nRowNo >= 0 )
		EnsureVisibleRow( nRowNo );
}
Here is the corresponding call stack:
void CExtTreeGridWnd::ItemExpand(
	HTREEITEM hTreeItem,
	INT nActionTVE, // = TVE_TOGGLE // TVE_COLLAPSE, TVE_EXPAND, TVE_TOGGLE only
	bool bRedraw // = true
	)
calling
void CExtTreeGridWnd::ItemEnsureVisibleBranch(
	HTREEITEM hTreeItem,
	bool bRedraw // = true
	)
calling
bool CExtReportGridWnd::EnsureVisibleRow(
	LONG nRowNo,
	bool bRedraw // = true
	)
calling
bool CExtGridBaseWnd::EnsureVisibleRow(
	LONG nRowNo,
	bool bRedraw // = true
	)
{
	ASSERT_VALID( this );
	if( nRowNo < 0 )
	{
		ASSERT( FALSE );
		return false;
	}
...
}


The intension behind this function is to expand a HTREEITEM and make it visible for the user.
What can I do to make the code running without the assertion (like it was in v2.80)?


Kind regards,

Martin

Technical Support Feb 7, 2008 - 8:35 AM

It seems we have fixed this issue. Please send us a request for the update to support@prof-uis.com.

Martin Baumgaertner Feb 4, 2008 - 10:21 AM

Dear ProfUIS-Team,

sorry for asking again, but we are a little under pressure concerning an update to ProfUIS v2.82 with respect to our new release. Before we dare to perform this step we have to consider some issues to be solved, and this one happens to be one of the most striking.

Please let me know as soon as possible if I can count on a solution (workaround ...) to the described problem.

Kind regards,

Martin

Martin Baumgaertner Jan 28, 2008 - 3:31 AM

Just not to be forgotten ;-) ... any progress?

Martin

Martin Baumgaertner Jan 18, 2008 - 9:29 AM

Here comes the MSVS 8.0 stack trace for the ProfUIS part:

>	ProfUIS282md.dll!CExtGridBaseWnd::EnsureVisibleRow(long nRowNo=-1, bool bRedraw=true)  Line 6310 + 0x17 bytes	C++
 	ProfUIS282md.dll!CExtReportGridWnd::EnsureVisibleRow(long nRowNo=-1, bool bRedraw=true)  Line 6046	C++
 	ProfUIS282md.dll!CExtTreeGridWnd::ItemEnsureVisibleBranch(_TREEITEM * hTreeItem=0x07b57dec, bool bRedraw=true)  Line 3657 + 0x1a bytes	C++
 	ProfUIS282md.dll!CExtTreeGridWnd::ItemExpand(_TREEITEM * hTreeItem=0x07b57dec, int nActionTVE=2, bool bRedraw=true)  Line 3633 + 0x1a bytes	C++
 	Dlg.dll!CItemBrowser::FocusAndSelectItemFound(_TREEITEM * const hTreeItem=0x07b57dec)  Line 2119 + 0x1a bytes	C++
Suppose two group items and three data rows, all collapsed, but - at least in case of this small example - inside the visible range of items, i.e. expanding exposes them all visible.

It might be interesting that the following function connected to an "Expand All" button works without problems:
void
CItemBrowser::ExpandAll ( )
{
	HTREEITEM hTreeItem = NULL;

	for ( LONG i=0; i<RowCountGet(); ++i )
	{
		hTreeItem = ItemGetByVisibleRowIndex( i );
		ASSERT( hTreeItem != NULL );

		if ( ItemGetChildCount( hTreeItem ) > 0 )
		{
			ItemExpandAll(
				hTreeItem,
				TVE_EXPAND
				);
		}
	}

	//
	// Updating view
	//
	CExtGridDataSortOrder gdsoColumns;

	CExtGridDataSortOrder::ITEM_INFO _soii( 
		0, // sort first column
		true // true - ascending sort order, false - descending
		);

	gdsoColumns.m_arrItems.Add( _soii );

	GridSortOrderSetup(
		false, // true - sort colums, false - sort rows
		gdsoColumns,
		false,
		false, // invert sort order
		false
		);

	OnSwUpdateScrollBars();
	OnSwDoRedraw();
}
Please tell me if you need further information.

Technical Support Jan 18, 2008 - 4:20 AM

Rows in the tree grid, report grid and property grid (v.2.82) are expanded in the same way as in the tree view common control. So, we recommend you not to change it back. Please provide us with the content of the Call Stack window in Visual Studio and the exact location of the assertion failure. It would be also very helpful to get more information about the location of tree item which you are going to focus and/or expand. Is it under a collapsed item? Is it outside the visible range of items?