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 General Discussion » CExtGridCellDateTime: making enabled DatePicker readonly? Collapse All
Subject Author Date
Martin Baumgaertner Jul 10, 2007 - 8:52 AM

Hello,

based on the following code:

CExtGridCell * pCell = ReportItemGetCell( pPB, pRGI, RUNTIME_CLASS( CExtGridCellDateTime ) );
pCell->TextSet(timedate_str);
How can I make the date picker control enabled readonly? With pCell->ModifyStyle(__EGCS_READ_ONLY) the whole cell would be readonly with the date picker being totally disabled.

Martin

Martin Baumgaertner Jul 16, 2007 - 7:48 AM

Now everything is working like it should, thank you!

Martin

Martin Baumgaertner Jul 13, 2007 - 2:59 AM

Using your implementation I get two compiler errors:

Error 26 error C2665: ’CExtGridCell::operator new’ :
	none of the 2 overloads could convert all the argument types
Error 27 error C2664: ’CExtGridCellDateTime::CExtGridCellDateTime(CExtGridDataProvider *)’ :
	cannot convert parameter 1 from ’const CExtGridCell’ to ’CExtGridDataProvider *’
The second conflict could be solved by using the following code for the copy constructor instead:
CMyGridCell::CMyGridCell( const CExtGridCell & other )
{
	CExtGridCellDateTime::Assign(other);
}
Is this ok?

But for the first error I could not find any solution that makes it work. It comes up with the following line:
IMPLEMENT_SERIAL( CMyGridCell, CExtGridCellDateTime, VERSIONABLE_SCHEMA|1 );
Any idea?

Martin

Technical Support Jul 13, 2007 - 12:10 PM

Please read this FAQ article:

I derived a class from CExtGridCell but it fails to be compiled, what may be wrong?

If the problem persists, just let us know.



Martin Baumgaertner Jul 13, 2007 - 1:18 AM

Thank you very much for this!

Martin

Martin Baumgaertner Jul 12, 2007 - 4:00 AM

My Idea: I want to show (localized, readonly) timestamps as strings in one column of a report grid.

How can I guarantee the correct sort order without depending on the date picker control, i.e. can I use the sorting benefits of type CExtGridCellDateTime without having to display the triangle button for the date picker?

Martin

Technical Support Jul 12, 2007 - 10:16 AM

You should use a CExtGridCellDateTime-derived class, which implements a custom comparison algorithm:

class CMyGridCell : public CExtGridCellDateTime
{
public:
    DECLARE_SERIAL( CMyGridCell );
    IMPLEMENT_ExtGridCell_Clone( CMyGridCell, CExtGridCellDateTime );
    CMyGridCell(
        CExtGridDataProvider * pDataProvider = NULL
        );
    CMyGridCell( const CExtGridCell & other );
    virtual int Compare(
        const CExtGridCell & other,
        DWORD dwStyleMask = __EGCS_COMPARE_MASK,
        DWORD dwStyleExMask = __EGCS_EX_COMPARE_MASK
        ) const;
}; // class CMyGridCell



IMPLEMENT_SERIAL( CMyGridCell, CExtGridCellDateTime, VERSIONABLE_SCHEMA|1 );
 
CMyGridCell::CMyGridCell(
    CExtGridDataProvider * pDataProvider // = NULL
    )
    : CExtGridCellDateTime( pDataProvider )
{
}
 
CMyGridCell::CMyGridCell( const CExtGridCell & other )
    : CExtGridCellDateTime( other )
{
}
int CMyGridCell::Compare(
    const CExtGridCell & other,
    DWORD dwStyleMask, // = __EGCS_COMPARE_MASK
    DWORD dwStyleExMask // = __EGCS_EX_COMPARE_MASK
    ) const
{
    ASSERT_VALID( this );

    ...

    return ...
}


Martin Baumgaertner Jul 11, 2007 - 1:34 AM

Thank you for answering.

By the way, you supply a great forum, always helpful and friendly, thank you!

Technical Support Jul 10, 2007 - 12:32 PM

Unfortunately the popup CExtDatePickerWnd date picker control does not support the read only mode. We can only regard your question as a feature request.