Get column title |
Post Reply |
Author | |
gmail
Groupie Joined: 24 February 2008 Status: Offline Points: 45 |
Post Options
Thanks(0)
Posted: 08 September 2009 at 6:55pm |
How can I set my own custom title name for e.g. first day in the week (i.e. on week view instead of 'Monday' I want to set 'Christmas')? Thanks for replying.
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
You can use: GetCalendarCtrl().m_bFullDateMode = TRUE; CXTPCalendarDayView* pDayView = DYNAMIC_DOWNCAST(CXTPCalendarDayView, GetCalendarCtrl().GetDayView() ); if (pDayView) { pDayView->SetDayHeaderFormat(_T("Holiday %A, %B %d, %Y")); } - but it give you custom title for DayView or multi-column week view and every day will be Holiday (!). May be in next version we will make something for special title string for different days Still you can use any combination of date-related C-format (%a %b ...)
But this is static (same for all days) custom text
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
You can use notification - e.g.
VB Calendar Sample notification handler:
Private Sub CalendarControl_GetItemText(ByVal Params As XtremeCalendarControl.CalendarGetItemTextParams) ............................................................................................. If Params.Item = xtpCalendarItemText_DayViewDayHeaderRight Or _ Params.Item = xtpCalendarItemText_WeekViewDayHeaderRight Or _ Params.Item = xtpCalendarItemText_MonthViewDayHeaderRight _ Then Params.Text = Year(Params.ViewDay.Date) & " - Your happy day" .............................................................................................
End Sub you need to add subscription to notification in your Form load function call CalendarControl.AskItemTextFlags.SetFlag xtpCalendarItemText_DayViewDayHeaderRight Samething you can use in MFC -
CString CXTPCalendarDayViewDay::GetCaption() { COleDateTime dt(m_dtDate); SYSTEMTIME st; GETASSYSTEMTIME_DT(dt, st); CString strHeaderFormat = GetView() ? GetView()->GetDayHeaderFormat() : _T( "");CString strResult = CXTPCalendarUtils::GetDateFormat(&st, strHeaderFormat); if (strHeaderFormat.Find(_T("%")) > -1) //C-format usedstrResult = dt.Format(strHeaderFormat); DWORD dwFlags = XTP_SAFE_GET2(GetView(), GetCalendarControl(), GetAskItemTextFlags(), 0); if (dwFlags & xtpCalendarItemText_DayViewDayHeader){ XTP_CALENDAR_GETITEMTEXT_PARAMS objRequest; ::ZeroMemory(&objRequest, sizeof(objRequest));objRequest.nItem = ( int)xtpCalendarItemText_DayViewDayHeader;objRequest.pstrText = &strResult; objRequest.pViewDay = this;XTP_SAFE_CALL2(GetView(), GetCalendarControl(), SendNotificationAlways( XTP_NC_CALENDAR_GETITEMTEXT, (WPARAM)&objRequest, 0)); } return strResult;} Just use nofification XTP_NC_CALENDAR_GETITEMTEXT |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |