Print Page | Close Window

How to select item for edit

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=4323
Printed Date: 28 April 2024 at 12:55pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to select item for edit
Posted By: jimmy
Subject: How to select item for edit
Date Posted: 01 June 2006 at 11:05am
Hello,
 In a function i will save the current item state (edit,..)
then i remove all item, put new items,
and set old item state.

void MyFunction()
{
    bool bSetFocus = false;
    UINT nID = 0;
    CXTPPropertyGridItem *pItem = GetSelectedItem();
    if (pItem)
    {
        nID = pItem->GetID();
        if (pItem->GetFlags() & (xtpGridItemHasEdit | xtpGridItemHasExpandButton | xtpGridItemHasComboButton))
            bSetFocus = true;
    }
    __super::Refresh(); // Clear and fill new
    if (bSetFocus)
    {
        CXTPPropertyGridItem *pItem = FindItem(lParam);
        if (pItem)
            pItem->Select();
    }
}

But after pItem->Select() i don't see the Inputcursor.

    Jimmy




Replies:
Posted By: Oleg
Date Posted: 01 June 2006 at 12:40pm

Hi,

try manually set focus:

pItem->GetInplaceEdit().SetFocus();



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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