<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : How To switch back in day mode?</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Calendar : How To switch back in day mode?]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 30 May 2026 16:40:44 +0000</pubDate>
  <lastBuildDate>Wed, 06 Aug 2008 14:42:01 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=10157</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[How To switch back in day mode? : Hello, You are right.  CXTPC...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10157&amp;PID=39525&amp;title=how-to-switch-back-in-day-mode#39525</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3233">AndreiM</a><br /><strong>Subject:</strong> 10157<br /><strong>Posted:</strong> 06 August 2008 at 2:42pm<br /><br />Hello,<DIV>You are right. </DIV><DIV>CXTPCalendarControl::SetDataProvider is used to easy set a single resource.</DIV><DIV>CXTPCalendarControl::SetResources is used to set&nbsp;one or few resources.</DIV><DIV>&nbsp;</DIV><DIV>Calendar is multi-scheduled in the kernel. There is no special single resource mode.&nbsp;</DIV><DIV>If you set only one resource - it just does not show resource header (name)&nbsp;by default .</DIV><DIV>&nbsp;</DIV><DIV>KumarCJ in his code remove all resources and does not add one.</DIV><DIV>&nbsp;</DIV><DIV>GetDataProvider() simply return first resource data provider. </DIV><DIV>&nbsp;</DIV><DIV>FYI. Each resource may have own separate data provider as far as one data provider may be used for many resources.</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 06 Aug 2008 14:42:01 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10157&amp;PID=39525&amp;title=how-to-switch-back-in-day-mode#39525</guid>
  </item> 
  <item>
   <title><![CDATA[How To switch back in day mode? : Not 100% sure of what&amp;#039;s going...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10157&amp;PID=38883&amp;title=how-to-switch-back-in-day-mode#38883</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2657">Algae</a><br /><strong>Subject:</strong> 10157<br /><strong>Posted:</strong> 25 July 2008 at 3:16am<br /><br />Not 100% sure of what's going on based on your code, but I did not see in your code where you set the original provider again.<br><br>Set new (same as original) provider:<br><br>pCalendar-&gt;SetDataProvider(GetDataProvider(), FALSE);<br><br>where GetDataProvider() returns your original provider such as SQLDataProvider etc.<br><br>You have to set the new (old!) provider in order to repopulate.<br><br><img src="http://forum.codejock.com/smileys/smiley32.gif" border="0" align="absmiddle"><br>]]>
   </description>
   <pubDate>Fri, 25 Jul 2008 03:16:59 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10157&amp;PID=38883&amp;title=how-to-switch-back-in-day-mode#38883</guid>
  </item> 
  <item>
   <title><![CDATA[How To switch back in day mode? : Hi,   I have one doubt, I implemented...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10157&amp;PID=38738&amp;title=how-to-switch-back-in-day-mode#38738</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2903">KumarCJ</a><br /><strong>Subject:</strong> 10157<br /><strong>Posted:</strong> 23 July 2008 at 2:18am<br /><br />Hi, <DIV>&nbsp;</DIV><DIV>I have one doubt, I implemented two modes 1) Multischedule and 2) Day</DIV><DIV>&nbsp;</DIV><DIV>In multischedule mode I can see newly added scedules (Columns) but when I try to switch back to Day mode Columns remains as it is.</DIV><DIV>&nbsp;</DIV><DIV>My question is </DIV><DIV>&nbsp;</DIV><DIV>How to remove schedules while switching back to Day mode?</DIV><DIV>&nbsp;</DIV><DIV>I tried following code but CAlendar cntrol is turning whole <FONT color=#ff0000>RED</FONT></DIV><DIV><FONT color=#ff0000></FONT>&nbsp;</DIV><DIV><FONT color=#ff0000>Code:-</FONT></DIV><DIV><FONT color=#ff0000></FONT>&nbsp;</DIV><DIV>CXTPCalendarControl* pCalendarCtrl = &amp;this-&gt;GetCalendarCtrl();<BR>CXTPCalendarData * pData = pCalendarCtrl-&gt;GetDataProvider();<BR></DIV><DIV>if (!pData)<BR>&nbsp;&nbsp;&nbsp;&nbsp;return;<BR>&nbsp;&nbsp; </DIV><DIV>pSchedules = pData-&gt;GetSchedules();<BR>&nbsp;&nbsp; <BR>&nbsp;&nbsp; </DIV><DIV>if (!pSchedules)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </DIV><DIV><BR>int iCnt = pCalendarCtrl-&gt;GetResources()-&gt;GetCount();&nbsp;&nbsp;</DIV><DIV>// Here I am getting proper column/schedule count (2)</DIV><DIV>for (int i = 0; i &lt; iCnt; i++ )<BR>{</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp; pCalendarCtrl-&gt;GetResources()-&gt;RemoveAt(0);<BR>}</DIV><DIV>&nbsp;</DIV><DIV>Thanks in advance.</DIV>]]>
   </description>
   <pubDate>Wed, 23 Jul 2008 02:18:57 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10157&amp;PID=38738&amp;title=how-to-switch-back-in-day-mode#38738</guid>
  </item> 
  <item>
   <title><![CDATA[How To switch back in day mode? : As you probably discovered there&amp;#039;s...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10157&amp;PID=34534&amp;title=how-to-switch-back-in-day-mode#34534</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2657">Algae</a><br /><strong>Subject:</strong> 10157<br /><strong>Posted:</strong> 01 May 2008 at 4:48pm<br /><br /><br>As you probably discovered there's no method illustrated in the samples to revert to the original "day view" mode after using a multiple configuration. However, it is possible.<br><br>What you need to do is recreate the original calendar resource. When you debug you can see that there is indeed a calendar resource created when you start in day view mode.&nbsp; It has a blank string for name so it doesn't display anything at the top of the calendar.<br><br>Here is an example of using a new resource when switching to restore day view mode:<br><br>void CCalendarDoc::OnScheduleSelect()<br>{<br>&nbsp;&nbsp;&nbsp; CSchedDlg dlg;<br>&nbsp;&nbsp;&nbsp; int nDlgRes = (int)dlg.DoModal();<br>&nbsp;&nbsp;&nbsp; if (nDlgRes == IDOK)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPCalendarControl* pCalendar = GetCalendarCtrl();<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( dlg.m_pResources-&gt;GetCount() )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pCalendar-&gt;SetResources(dlg.m_pResources);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pCalendar-&gt;Populate();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pCalendar-&gt;RedrawControl();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; CXTPCalendarResource *pResource = new CXTPCalendarResource(pCalendar);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (!pResource) <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ASSERT(FALSE);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pResource-&gt;SetDataProvider(pCalendar-&gt;GetDataProvider());<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pResource-&gt;SetName(_T(""));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pCalendar-&gt;GetResources()-&gt;Add(pResource);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for (int i = 0; i &lt; pCalendar-&gt;GetResources()-&gt;GetCount(); i++ )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (pResource-&gt;GetName() != _T("") )<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pCalendar-&gt;GetResources()-&gt;RemoveAt(i);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><br>There are probably other, better ways of doing this but this works. I tried a couple other approaches which failed and I'm not 100% sure why, but I believe it's due to the way smart pointers are used.<br><br>A couple of things to avoid:<br><br>1. GetResources-&gt;RemoveAll() will fail.&nbsp; <br>2. Maintaining a copy of the original resource and trying to reuse it will fail and it's scarcely worth the effort.<br><br>Hope this helps you out. It takes some digging to see exactly what the system expects. Maybe CJ can include the methodology in their sample so others aren't stuck on this.<br><br><img src="http://forum.codejock.com/smileys/smiley1.gif" border="0" align="absmiddle"><br><br><br>]]>
   </description>
   <pubDate>Thu, 01 May 2008 16:48:35 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10157&amp;PID=34534&amp;title=how-to-switch-back-in-day-mode#34534</guid>
  </item> 
  <item>
   <title><![CDATA[How To switch back in day mode? : Hi Oleg,We have Day, 2 Days, Week,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10157&amp;PID=33387&amp;title=how-to-switch-back-in-day-mode#33387</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2774">prashant</a><br /><strong>Subject:</strong> 10157<br /><strong>Posted:</strong> 10 April 2008 at 1:37am<br /><br />Hi Oleg,<br><br>We have Day, 2 Days, Week, 2 Weeks, Month and Multi Schedule Views for Calendar.<br><br>Issue: <br>When we want to go back to "Day" View from "MultiShedule" View, View is not getting changed to DAY View and not getting displayed.<br><br>Thanks in advance.<br>]]>
   </description>
   <pubDate>Thu, 10 Apr 2008 01:37:49 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10157&amp;PID=33387&amp;title=how-to-switch-back-in-day-mode#33387</guid>
  </item> 
  <item>
   <title><![CDATA[How To switch back in day mode? : As per shown in the example I...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=10157&amp;PID=33347&amp;title=how-to-switch-back-in-day-mode#33347</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2774">prashant</a><br /><strong>Subject:</strong> 10157<br /><strong>Posted:</strong> 09 April 2008 at 9:32am<br /><br />As per shown in the example I added multiple schedules. Now I want to switch back in Day mode/View. How to achieve this?]]>
   </description>
   <pubDate>Wed, 09 Apr 2008 09:32:56 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=10157&amp;PID=33347&amp;title=how-to-switch-back-in-day-mode#33347</guid>
  </item> 
 </channel>
</rss>