Print Page | Close Window

Select GridItem from mainfrm programmatically

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=9696
Printed Date: 22 November 2024 at 7:22am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Select GridItem from mainfrm programmatically
Posted By: andrewg
Subject: Select GridItem from mainfrm programmatically
Date Posted: 25 February 2008 at 10:07am
I'm currently attempting to select a propertygrid Item from the mainfrm and set the cursor in the item so the user doesn't have to move the mouse over and click into it. It's not quite working. The item is being selected but the cursor is not appearing.

MainFrm:

m_userPropertySheet->m_propertyGrid.SetFocus();
m_userPropertySheet->OnNew();


PropertySheet:

void CPropertySheet::OnNew() {
...
pItem = m_propertyGrid.GetCategories()->GetAt(0)->GetChilds()->GetAt(0);

pItem->Select();
pItem->GetInplaceEdit().SetFocus();
...
}


Anyone know how to get this to work?




Replies:
Posted By: Barto
Date Posted: 27 February 2008 at 10:31am
maybe try something like this:
 

    pGrid->SetFocus();
    pGrid->SetCurSel(nIndex);
    pGrid->OnSelectionChanged();
    pItem = pGrid->GetItem(nIndex);
    pItem->OnSelect();
    pItem->SetFocusToInplaceControl();



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