Print Page | Close Window

Excel style keyboard for report control

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=4407
Printed Date: 19 July 2025 at 12:09am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Excel style keyboard for report control
Posted By: Warren
Subject: Excel style keyboard for report control
Date Posted: 14 June 2006 at 11:14am
I'm using the report control in a dialog. I have two columns and a variable number of rows (e.g. 7 rows). I'm basically using the report control as a simplified "grid control", which works well, except for the keyboard use. 

Although I've purchased a grid control (Dundas) I'd rather not use it (or any another grid control for that matter), because I want my validation/look+feel/etc to be uniform throughout the application.

My particular issues are:
1) When editing a cell, pressing Enter doesn't move to the next cell below.
2) When editing a cell, pressing the up/down arrow doesn't move to the next cell.

So my question/request is...

Is there a simple way to make the report control act like a grid control, or should I just catch the keyboard messages and try to respond appropriately? I guess I can derive + do this myself, but I imagine it's a common request, so maybe you could make up an "excel" sample app?

Thanks

Warren



Replies:
Posted By: pascal
Date Posted: 14 June 2006 at 11:29am
Hi, we also need this feature. We used in the past the CUGGrid from Dundas. Please add the functionallity to a next release.

-------------
Pascal Verdier
Software Engineer Manager


Posted By: sserge
Date Posted: 15 June 2006 at 4:24pm
Hi,

Report control has some standard behavior, and a lot of functionality for customization Wink

This feature could be implemented easily with handling XTP_NM_REPORT_PREVIEWKEYDOWN message. See below for an example:

ON_NOTIFY(XTP_NM_REPORT_PREVIEWKEYDOWN, XTP_ID_REPORT_CONTROL, OnReportPreviewKeyDown)
.....
void CYourForm::OnReportPreviewKeyDown(NMHDR * pNotifyStruct, LRESULT *result)
{
    XTP_NM_REPORTPREVIEWKEYDOWN* pKeyNotify = (XTP_NM_REPORTPREVIEWKEYDOWN*) pNotifyStruct;
    ASSERT(pKeyNotify);

    if (pKeyNotify->nChar == VK_DOWN)
    {
        pKeyNotify->bCancel = TRUE;
        m_wndReport.GetNavigator()->MoveDown();
    }
    else if (pKeyNotify->nChar == VK_UP)
    {
        pKeyNotify->bCancel = TRUE;
        m_wndReport.GetNavigator()->MoveUp();
    }
    else if (pKeyNotify->nChar == VK_RETURN)
    {
        pKeyNotify->bCancel = TRUE;
        m_wndReport.GetNavigator()->MoveDown();
    }
}


--
WBR,
Serge



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