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 Tech Support » CExtTreeGridWnd::ItemInsert() - filtered rows Collapse All
Subject Author Date
Alastair Watts Sep 6, 2010 - 9:24 AM

How do I insert a row into a filtered tree grid whilst honouring if/where the new row should be inserted, other than to:


1. Save filters


2. Clear filters


3. Insert item


4. restore filters

Alastair Watts Sep 7, 2010 - 7:18 AM

It crashes calling ItemInsert(ItemGetRoot(), nIndex) when nIndex is greater than the number of visible rows, so I assumed nIndex was a visible index.  Any sugestions?

Technical Support Sep 8, 2010 - 7:26 AM

Could you show the call stack listing at the assertion time?

Alastair Watts Sep 7, 2010 - 3:42 AM

Thanks for that.


I manage my own sorting and want to insert an item between rows that may be hidden, can I do this without saving/clearing/restoring the filter?


I would be nice if ItemInsert() could take a HTREEITEM instead of a visible row index & insert into the full grid whilst filters are applied - the new item only being displayed if it meets the filters criteria.


 


 

Technical Support Sep 7, 2010 - 5:47 AM

The CExtTreeGridWnd::ItemInsert() method does what you need. The nIdxInsertBefore parameter is an index in the array of all child nodes including the hidden ones. The CExtTreeGridWnd::ItemGetSiblingIndexOf() method allows you to convert a tree item handle into its sibling index.

Technical Support Sep 7, 2010 - 12:49 AM

You should insert a new row and initialize grid cells first. You don’t need to save/restore filters. The CExtGridWnd::OnGridFilterUpdateForColumns() / CExtGridWnd::OnGridFilterUpdateForRows() methods should be invoked to re-filter the grid control. The grid control uses these methods to re-filter edited data when the in-place grid cell editing is complete (CExtGridWnd::OnGridCellInputComplete()).