Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Problem using GetSelectedRows() after user keydown
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Problem using GetSelectedRows() after user keydown

 Post Reply Post Reply
Author
Message
nguyena1 View Drop Down
Groupie
Groupie


Joined: 28 November 2005
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote nguyena1 Quote  Post ReplyReply Direct Link To This Post Topic: Problem using GetSelectedRows() after user keydown
    Posted: 25 September 2006 at 12:08pm
Hey all, has anyone had issues trying this? 

I'm trying to have the user be able to hit the delete button on a selected row and have the item go away.  The issue I'm having is using GetSelectedRows().

I'm handling the key down using NM_KEYDOWN and XTP_NM_REPORT_PREVIEWKEYDOWN.  After I call GetSelectedRows(), GetCount or GetFirstSelectedRowPosition, I get 0 when I DO have a item selected.

However, another case im handling is mouse clicks and selection changes using NM_CLICK and XTP_NM_REPORT_SELCHANGED.  In the handling of message for these, GetCount or GetFirstSel... work fine.

Is this because the keystrokes messages are sent before the reportcontrol sets up its CXTPReportSelectedRows?
And I assume the other 2(click and selchanged) are messages sent after?

I have also tried, GetFocusedRow, but this still returns a row even if I dont have a row selected. 

What is a solution that I can get the selected row after a user keydowns?  Help would be much appreciated.

Tony
Back to Top
nguyena1 View Drop Down
Groupie
Groupie


Joined: 28 November 2005
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote nguyena1 Quote  Post ReplyReply Direct Link To This Post Posted: 25 September 2006 at 12:11pm
FYI: I am using version 10.1
Back to Top
nguyena1 View Drop Down
Groupie
Groupie


Joined: 28 November 2005
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote nguyena1 Quote  Post ReplyReply Direct Link To This Post Posted: 25 September 2006 at 5:43pm
Never mind!  Sorry, I found out that somewhere else in a timered update, the selected rows were being cleared, which is why i wasn't seeing them on key down.  
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.156 seconds.