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 » CExtPropertyGridCtrl problem Collapse All
Subject Author Date
Alastair Watts Feb 8, 2012 - 10:00 AM


We constrain some cell values which works just fine, however, when PropertyStoreSynchronize() is called the cell displays the previous un-constrained value.  What am I missing?




void CWidgetManagerPagePropertyValueHeaderSize::Apply(CExtGridCell* pValue)

{

 ASSERT_VALID(this);

 CWidgetManagerPagePropertyValueBase::Apply(pValue);

 if(m_pPaperCtrl == NULL)

  return;


 CExtGridCellUpDown* pValueUpDown = STATIC_DOWNCAST(CExtGridCellUpDown, ((pValue == NULL) ? ValueActiveGet() : pValue));


 m_pPaperCtrl->SetPageHeaderSize(pValueUpDown->lVal);

 UINT nNewValue = m_pPaperCtrl->GetPageHeaderSize();

 pValueUpDown->_VariantAssign(nNewValue, VT_I4);

}


void CWidgetManagerPropertiesCtrl::OnPgcInputComplete( CExtPropertyGridWnd* pPGW,

              CExtPropertyItem*  pPropertyItem )

{

 CExtPropertyGridCtrl::OnPgcInputComplete(pPGW, pPropertyItem);


 if( pPropertyItem->IsKindOf(RUNTIME_CLASS(CWidgetManagerPagePropertyValueHeader)) ||

  pPropertyItem->IsKindOf(RUNTIME_CLASS(CWidgetManagerPagePropertyValueFooter)) ||

  pPropertyItem->IsKindOf(RUNTIME_CLASS(CWidgetManagerPagePropertyValueBorderType)) ||

  pPropertyItem->IsKindOf(RUNTIME_CLASS(CWidgetManagerPropertyValueBkgndType)) ||

  pPropertyItem->IsKindOf(RUNTIME_CLASS(CWidgetManagerPropertyValueTextFormat)) )

 {

  PropertyStoreSynchronize();

 }

}






 



 

Technical Support Feb 17, 2012 - 11:36 AM

The CWidgetManagerPropertiesCtrl::OnPgcInputComplete() method invokes the PropertyStoreSynchronize() API just for particular cell types and without performing any additional actions. You need to invoke PropertyStoreSynchronize() API only if your code changes some properties and needs to make changes visible in tree grid windows inode property grid control. In all the other cases property grid control takes care about performing any value synchronizations. The CWidgetManagerPagePropertyValueHeaderSize::Apply() should invoke the parent class Apply() method finally - not initially. Please fix this.

Alastair Watts Feb 17, 2012 - 4:24 AM

The problem occurs using the standard CExtGridCellUpDown class and not one derived from it.


I got it working by deriving from CExtGridCellUpDown & contsraining the value there.  I think its a better solution as the up/down buttons are now enabled/disabled.

Technical Support Feb 17, 2012 - 2:10 AM

Could you check if you specified IMPLEMENT_ExtGridCell_Clone in grid cell declarations?
This is discussed here:
http://www.prof-uis.com/prof-uis/tech-support/feature-articles/prof-uis-grid-brief-overview.aspx

Alastair Watts Feb 14, 2012 - 4:07 AM

Any help guys?