Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Property Grid
  New Posts New Posts RSS Feed - How to select item for edit
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to select item for edit

 Post Reply Post Reply
Author
Message
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Topic: How to select item for edit
    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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 01 June 2006 at 12:40pm

Hi,

try manually set focus:

pItem->GetInplaceEdit().SetFocus();

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.