Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Sample Code pls. Collapse All
Subject Author Date
Srinivasan Natarajan Jul 28, 2005 - 9:52 PM

Hi ,


 


i would like to add CExtGridWnd control into a  CExtResizableDialog, but the sample code explains about how to add   control to the CExtTabPageContainerFlatWnd.


I don’t want tab page container, i would like to directly put the control on the CExtResizableDialog itself.


 


hope that you would send the sample code


 


regards


sundar


cynaptix technologies


 


 

Srinivasan Natarajan Aug 2, 2005 - 7:25 AM

Hi,


Thanks for the response. I sorted out the issue, i made a mistake by inserting the return statement inside the if condition " if( nRepCnt == 2 ) ". Once i took the return statement outside the loop it works.


 


 // if double click   
  //return   CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent(nChar, nRepCnt, nFlags, point );
 }


  return   CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent(nChar, nRepCnt, nFlags, point );
}


It is suppose to take the default action except double click.


 


 


Also i made a correction by adding


 if ( (pCell != NULL)  && (!pCell->IsKindOf(RUNTIME_CLASS(CExtGridCellHeader)))) to avoid the procedure gets fired when the user double clicks on the header itself.


thanks for the mail.


regards


sundar


 


 

Srinivasan Natarajan Aug 2, 2005 - 5:16 AM

Hi,


Thanks for the Code, Now it works fine. But it has disabled the nice feature of SORTING . Now it doesn’t sort when you click on the headers. Hope that you would resolve this issue.


thanks & regards


sundar


 

Technical Support Aug 2, 2005 - 7:11 AM

To enable the sorting feature for columns in your grid, just apply the __EGWS_BSE_SORT_COLUMNS style:

m_wndGrid. BseModifyStyle( __EGWS_BSE_SORT_COLUMNS, 0 );
If you need the multiple column sorting feature, add the __EGWS_BSE_SORT_MULTIPLE_COLUMNS style instead.

Technical Support Jul 29, 2005 - 11:17 AM

We have sent you a sample project by e-mail. This very simple project demonstrates how to use the grid control in the dialog.

Simon DESEE Aug 21, 2005 - 10:54 AM

Hello,


I’m also interested for this sample.


Could you send it to me by mail ?


Regards,


Simon

Eli Kaczer Sep 15, 2005 - 1:01 PM

I just posted this same question, before discovering this post.  Please email me the sample too...


thanks,


Eli

Technical Support Sep 16, 2005 - 5:16 AM

We sent you this sample by e-mail.

Technical Support Aug 21, 2005 - 11:41 AM

We sent you this application by e-mail as you requested.

Srinivasan Natarajan Jul 31, 2005 - 11:00 PM

Hi,


 


Thanks for the Code, By the way is there any way to have a double click method on the grid ( like listctrl control) ? Thanks for the reply.


expecting your reply


regards


sundar


 

Technical Support Aug 1, 2005 - 5:35 AM

The CExtGridWnd class was not conceived as a replacement for the CListView class. But it is possible to handle double click events in your CExtGridWnd-derived class. You need to override the CExtGridWnd::OnGbwAnalyzeCellMouseClickEvent() method like as follows:

bool C_YOUR_GridWnd::OnGbwAnalyzeCellMouseClickEvent(
    // the nChar parameter:
    // VK_LBUTTON, VK_RBUTTON or VK_MBUTTON only
    UINT nChar,
    // the nRepCnt parameter:
    // 0 - button up, 1 - single click, 2 - double click,
    // 3 - post single click & begin editing
    UINT nRepCnt,
    // the nFlags parameter:
    // mouse event flags
    UINT nFlags,
    // the point paramerter
    // mouse pointer in client coordinates
    CPoint point
    )
{
    ASSERT_VALID( this );
    if( nRepCnt == 2 )
    { // if double click
        CExtGridHitTestInfo htInfo( point );
        HitTest( htInfo, false, true );
        if(    ( ! htInfo.IsHoverEmpty() )
            || htInfo.IsValidRect()  )
        { // if some cell clicked

        } // if some cell clicked
        INT nColType = htInfo.GetInnerOuterTypeOfColumn();
        INT nRowType = htInfo.GetInnerOuterTypeOfRow();
        CExtGridCell * pCell =
                GridCellGet(
                    htInfo.m_nColNo,
                    htInfo.m_nRowNo,
                    nColType,
                    nRowType
                    );
        if( pCell != NULL )
        {
            ASSERT_VALID( pCell );
// TO DO:
// you should return true here if your code
// has handled the double click event
        }
  } // if double click
    return
        CExtGridWnd::
            OnGbwAnalyzeCellMouseClickEvent(
                nChar, nRepCnt, nFlags, point );
}