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 » CExtGridCellVariant and VT_DATE Collapse All
Subject Author Date
David Sousa Oct 10, 2006 - 1:27 PM

I would like to use the VT_DATE type for a grid cell in order to take advantage of sorting by dates. However, I would like to use a custom format for how the date string is displayed in the cell. Is this possible? Thanks.

David Sousa Oct 10, 2006 - 1:40 PM

To follow up on this, here is the code that I was trying to use:

CString text = date.Format(L"%x\r\n%A\r\n%X");
pCellVariant->ModifyStyleEx(__EGCS_EX_WRAP_TEXT);
pCellVariant->_VariantAssign(date.m_dt, VT_DATE);
pCellVariant->TextSet(text, false);

I could get the formating to work by using just %x, but nothing beyond that.

Technical Support Oct 11, 2006 - 10:56 AM

We would recommend you use the CExtGridCellDateTime cell class for dates. It is more feature rich than CExtGridCellVariant. In any case, you can always customize the cell representation by overriding the CExtGridCell::TextGet() virtual method.