Print Page | Close Window

PropertyGridItemEnum Selection...

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Property Grid
Forum Description: Topics Related to Codejock Property Grid
URL: http://forum.codejock.com/forum_posts.asp?TID=20235
Printed Date: 23 November 2024 at 7:20pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: PropertyGridItemEnum Selection...
Posted By: cooltoki
Subject: PropertyGridItemEnum Selection...
Date Posted: 18 October 2012 at 4:40am
Hello.
 
 
How can I unselect  on CXTPPropertyGridItemEnum ?
 
for example.
 
 
  CXTPPropertyGrid      m_wndGrid;
 
  CXTPPropertyGridItem* pBase = m_wndGrid.AddCategory( ID_PROP_BASE );
  CXTPPropertyGridItem* pItem;
  pItem = pBase->AddChildItem( new CXTPPropertyGridItemEnum("Test") );
      pItem->GetConstraints()->AddConstraint( L"Test 01", 0 );
      pItem->GetConstraints()->AddConstraint( L"Test 02", 1 );
  ............
 
  In above code,  "Test"  grid item is selected  "Test 01" (by default value 0(zero)).
 
 
 
  But, in some cases, I want to NOT SELECT "Test" grid item.
 
  pItem->GetConstraints()->SetCurrent( -1 );
 
  It does not work. Cry
  previous selection is still.
 
  How should I do ????
 
 
 



Replies:
Posted By: cooltoki
Date Posted: 18 October 2012 at 11:10pm
Ah... CXTPPropertyGridItemEnum  unselection is successed.

    CXTPPropertyGridItemEnum.SetEnum( -1 );


But, I want to same things as Enum to CXTPPropertyGridItemNumber.

I override CXTPPropertyGridItemNumber and use SetEditText( L"" ).
It works when that item is selected. but still displayed with "0" values if not selected.

How should i do ???


Posted By: cooltoki
Date Posted: 24 October 2012 at 8:52pm
Ah... It is solved by calling SetValue( L"" ) of CXTPPropertyGridItem class.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net