|  | 
| How to disable the sorting for all day event? | 
| Post Reply   | 
| Author | |
| Makarand   Senior Member     Joined: 27 February 2007 Location: India Status: Offline Points: 140 |  Post Options  Thanks(0)  Quote  Reply  Topic: How to disable the sorting for all day event? Posted: 05 January 2009 at 5:04am | 
| 
   Hi Oleg,
 How can I disable the soring for all day event? please see the attached image for more detail We do not want to have sorting, since the list we have in database is also not sorted. Now Codejock sorts the all day items, because of which our database list does not match with codejock all day items list. Thanks in advance, waiting for reply, -Mak | |
|  | |
| mdoubson   Senior Member     Joined: 17 November 2008 Status: Offline Points: 1705 |  Post Options  Thanks(0)  Quote  Reply  Posted: 05 January 2009 at 12:01pm | 
| 
   Hi,
 this is the sort function used inside, e.g. Populate call int_cdecl CXTPCalendarEvents::CompareEvents_ForView(const CXTPCalendarEvent** ppEv1, const CXTPCalendarEvent** ppEv2) {if (*ppEv1 == NULL || *ppEv2 == NULL) { ASSERT(FALSE);return XTPCompare(*ppEv1, *ppEv2); }int nPeriodDays1 = (*ppEv1)->GetEventPeriodDays(); int nPeriodDays2 = (*ppEv2)->GetEventPeriodDays(); int nAllDayEvent1 = (*ppEv1)->IsAllDayEvent() ? 1 : 0; int nAllDayEvent2 = (*ppEv2)->IsAllDayEvent() ? 1 : 0; BOOL bIsMultidayEvent = (nAllDayEvent1 && nAllDayEvent2 || nPeriodDays1 > 1 && nPeriodDays2 > 1);int nCmp = 0; //--------------------------------------------------------------------------- if (bIsMultidayEvent) { nCmp = XTPCompare((*ppEv1)->GetStartTime(), (*ppEv2)->GetStartTime());if (nCmp) {return nCmp; } }//--------------------------------------------------------------------------- nCmp = XTPCompare(nPeriodDays2, nPeriodDays1);if (nCmp) {return nCmp; } nCmp = XTPCompare(nAllDayEvent2, nAllDayEvent1);if (nCmp) {return nCmp; }if (!bIsMultidayEvent) { nCmp = XTPCompare((*ppEv1)->GetStartTime(), (*ppEv2)->GetStartTime());if (nCmp) {return nCmp; } } nCmp = XTPCompare((*ppEv1)->GetDurationMinutes(), (*ppEv2)->GetDurationMinutes());if (nCmp) {return -nCmp; }//----------------------------------------------------- nCmp = XTPCompare((*ppEv1)->GetSubject(), (*ppEv2)->GetSubject());if (nCmp) {return nCmp; }//----------------------------------------------------- nCmp = CompareEvents_ByID(ppEv1, ppEv2);return nCmp; } 
 virtualvoid Populate(COleDateTime dtDayDate) { ............................................. CXTPCalendarEventsPtr ptrEventsAr = new CXTPCalendarEvents(); ............................................// sort events by start time and some other criteria ptrEventsAr->Sort(CXTPCalendarEvents::CompareEvents_ForView); May be we can make this call optional?  Now looks like there is no way to eliminate this sort. | |
|  | |
| zitz   Senior Member   Joined: 05 October 2008 Status: Offline Points: 112 |  Post Options  Thanks(0)  Quote  Reply  Posted: 22 May 2009 at 5:41am | 
| 
   Need to fix it! 
 I want add my own sorting. How can I overload it? | |
|  | |
| 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 |