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 » How to Get Additional Checkbox value of Grid cell in CExtPropertyGridCtrl Collapse All
Subject Author Date
leo feng Jan 8, 2007 - 11:13 PM

I Means to hold 2 values in one cell (one checkbox and one other value like as updown or File path ),but invoke GetStyle canaˆ™t display any change about __EGCS_CHECKED style in OnPgcInputComplete function when you select and unselect Additional checkbox

Suhai Gyorgy Jan 9, 2007 - 5:19 AM

It should work. I tested this on PropertyGrid Prof-UIS sample.
- I added this class in MainDlg.h, before CMainDlg class’s declaration:

class CMyPropertyGridCtrl : public CExtPropertyGridCtrl
{
public:
	virtual void OnPgcInputComplete(
		CExtPropertyGridWnd * pPGW,
		CExtPropertyItem * pPropertyItem
		)
	{
		ASSERT_VALID( this );
		ASSERT_VALID( pPropertyItem );
		CExtPropertyGridCtrl::OnPgcInputComplete(
			pPGW,
			pPropertyItem
			);
		if (pPropertyItem->ValueActiveGet() != NULL) {
			DWORD dStyle = pPropertyItem->ValueActiveGet()->GetStyle();
			if ( (dStyle & __EGCS_CHECKED) == __EGCS_CHECKED )
				TRACE0("Checked\n");
			else 
				TRACE0("UnChecked\n");
		}
	}
};
- Change CExtPropertyGridCtrl m_PGC; to CMyPropertyGridCtrl m_PGC; in CMainDlg class declaration.
- Add one line in CStarButtonProperty_File contsructor in MainDlg.cpp:
CStarButtonProperty_File::CStarButtonProperty_File(
	CStarButton * pStarButton // = NULL
	)
	: CStarPropertyValueBase(
		_T("File"),
		pStarButton
		)
{
 ...
	ASSERT_VALID( pValue );
	pValue->ModifyStyle(__EGCS_CHK_CHECK|__EGCS_ICA_VERT_CENTER); // added this line
	ValueDefaultFromActive();
}
When running code and clicking on checkbox of file property, I can see the appropiate Checked/UnChecked lines appearing in VS Output Window. Try reproducing your problem in this sample or make a sample of your own to find out what’s wrong.