Programmatically created calendar view does not appear on view selector menu

Hi!
I'm using the following code to create a calendar view for a list:
using (var site = new SPSite("http://localhost"))
var viewFields = new System.Collections.Specialized.StringCollection { dateStartFieldName, dateEndFieldName, titleFieldName };
var query = string.Format("<Where><DateRangesOverlap><FieldRef Name='{0}' /><FieldRef Name='{1}' /><Value Type='DateTime'><Month /></Value></DateRangesOverlap></Where>", dateStartFieldName, dateEndFieldName);
var viewData = string.Format("<FieldRef Name='{0}' Type='CalendarMonthTitle' /><FieldRef Name='{0}' Type='CalendarWeekTitle' /><FieldRef Name='' Type='CalendarWeekLocation' /><FieldRef Name='{0}' Type='CalendarDayTitle' /><FieldRef Name='' Type='CalendarDayLocation' />", titleFieldName);
var list = site.RootWeb.Lists["ESM Leaves"];
var newView = list.Views.Add("Calendar11", viewFields, query, 0, true, false, SPViewCollection.SPViewType.Calendar, false);
newView.ViewData = viewData;
newView.MobileView = true;
newView.Update();
list.Update();
My problem is that even though the view is created, it does not appear in the View links just above my list. It only appears in the drop down menu of views in the ribbon. On the contrary, if I create the view using the browser user interface (not programmatically),
the view appears in both places.
Do you have any idea why this might be happening?
Dimitris Papadimitriou, Software Development Professional

Hi papadi,
I can reproduce the issue that creating calendar view using programming method, the view isn’t shown in view selector menu, and this only happens to calendar view, html view or other views are shown in the menu.
After editing the web part, disable the selector menu, then re-enable the selector menu again, I can see the calendar view shown in the view selector menu, create a new calendar view using programming, the calendar view shows as expected.
This seems indicate there is some issue in the view selector menu display, I would suggest you to first disable the view selector menu through edit the web part properties, then create the calendar view.
Thanks,
Qiao
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Qiao Wei
TechNet Community Support

Similar Messages

  • Created a new folder in bookmarks; when try to add new bookmark, new folder does not appear in drop down menu; using safari for windows

    created a new folder in bookmarks; when try to add new bookmark, new folder does not appear in drop down menu; using safari for windows

    You are using an older version of firefox, upgrade your browser to Firefox 8 and try
    * getfirefox.com

  • I can no longer burn a disc. The command to do so does not appear in my Files menu. All my recordings are 100% legal. I have installed a new version (it still looks the same), but that hasn't helped. I have done so before.

    All my music is from legal sources (albums owned by me, others from iTunes), but the Burn Disc command does not appear in the File menu, and nothing I do helps. I downloaded a new version of iTunes, but it still loks the same and may just be the same. But the problem started long before I did that.

    Meqmac wrote:
    This did nothing. Where do I click on the playlist? As far as I have experienced, the playlist is a list of songs with ticks against them on the left. I can use the control key, but where do I point my cursor to select the playlist?
    You don't even need to show the general Sidebar as suggested by others.
    Select Playlists in the top buttons:
    then control-click on the playlist you wish to burn in left column, e.g.:
    Regards.

  • Setting general   there is no siri option and siri even does not appear on holding the menu button. Can someone help me!!!! plzz

    setting>general  there is no siri option and siri even does not appear on holding the menu button. Can someone help me!!!! plzz

    Siri is not available for the iPad2, just the New Ipad (3).

  • Calendar item does not appear in day view for Sunday August 1, 2010

    I have a strange problem. I have an appointment on Sunday August 1, 2010. When in day view, and move from Saturday July 31 to Sunday Augsust 1 the appointment does not appear. However, if you look at list view or month view, it is there. If you continue to Monday and then go back to Sunday (all in day view) it appears. There is another person in my office with the exact same problem, so I know it is not just my phone. Anyone else have this issue? Any fix? I am concerned about appointments I will miss because of this. I added appoinments directly into the phone, no server, no exchange, no sync, same problem. It appears to be a bug in OS4.

    Refer following link for understanding & solution:
    Accounting document not posted from billing document SD module
    Hopefully this can assist you.
    Thanks & Regards
    JP

  • Event created on iPhone does not appear in iCal

    When I create an event on my phone and sync, it does not appear in iCal. Events created on my laptop sync without issue. Contacts sync both ways, but calendar events do not go from the phone to the computer. I am not using MobileMe to sync, simply using the USB cable.
    I have tried the following to resolve my issues:
    * Make sure iTunes and iPhone are up to date
    * Make sure all calendars are set to sync with iTunes
    * Try different USB ports on the laptop
    * Restart phone and computer
    * Reset sync history in iSync and re-sync
    * Follow directions in this support article: http://support.apple.com/kb/TS1627 to do a full reset of sync history and re-sync
    Yet after trying all of those solutions, I still cannot sync events created on my phone to my laptop. Does anyone out there know of anything else I can try that might work?
    Thank you,
    Cameron

    After a trip to the genius bar, I found how to solve this problem, at least for me:
    0) Plug in iPhone
    1) Start iCal
    2) Export all calendars (File -> Export)
    3) Quit iCal
    4) Delete all calendars from ~/Library/Calendars
    5) Start iCal
    6) Import all exported calendars
    7) Start iTunes, configure syncing to overwrite calendars on phone
    8) Sync iPhone

  • Enhancement view does not appear in my list of views

    Hi ,
    I have created an enhancement and now I used the wizard to add a new view to this application.The view created does not appear in my list of views but it appears in my Z BSP application.
    Please help!
    Regards
    Shilpi

    Check whether you are in Enhanced Version of UI Component !  (Original UI CMP name and Enhanceset : Z*)
    Thanks
    Allot points if this helps !

  • Calendar tab does not appear in iTunes iPod preferences

    The calendar and contacts tab does not appear when I go to preferences in iTunes with my iPod is attached. I am running 10.3.9. I have rebuilt permissions and trashed prefs. Are the tabs a 10.4 feature? They seemed to be a part of iTunes 5 so I suspect they should be there. I have read about using iSync on the posts but would prefer it happen automatically when I plug my new iPod in. Thanks for any help you can give me.

    Quote from the page below "If you are using Mac OS 10.3.9 or earlier, you cannot use iTunes to sync contacts and calendars to iPod"
    You can check out the page for details: http://docs.info.apple.com/article.html?artnum=301374

  • VTR OK does not appear in Viewer

    I connect my Canon or my JVS minidv cam. Set the cam to VCR or Play. Connect the fire wire. Click on FCP to open. It does and the appropriate screens open. I look under the controls on the Viewer in FCP and there appears nothing. No VTR OK or anything. The dialogue box that pops up if you did not have the cam turned on or connected does not appear. Any attempts to control the cam from my computer fail. The software seems to recognize the camera but not enough to place VTR OK or anything for that matter under the Viewers controls. Any thoughts? BTW it happens for both cameras and one year ago this was never a problem as I've outlined here. Thank you.

    Canon cameras do not always connect well using log and capture. I have an old GL1 that I let my grandkids use for school projects and I have to use capture now in order to get video and audio into FCP.
    Be sure your capture settings are for "non controllable device"
    Shut down FCP, plug the firewire in, restart FCP and it should show up.

  • HT1473 "Add Folder to Library" option does not appear on the File menu??? Please help.

    Please help.

    8675-30-9 wrote:
    Hello,  and thanks for your assistance.  however, I do not have that particular menu visible on my screen, I have only the half shaded box in the upper left of the screen and it does not appear in there when I click on it?  Any way to get the menu you are showing to appear on my program?  Is there a setting somewhere I am missing?
    Click the half-shaded box, and choose "Show Menu Bar." 
    That will enable the menu with File, Edit, View, etc.   Then you can proceed as above.

  • The selection 'photocast' does not appear on my share menu.

    I have a .mac account, but the "photocast" selection does not appear on my iphoto6 share menu.

    jntr:
    First delete the iPhoto Preference file. If that doesn't help try repairing disk permissions and, if necessary, reinstall iPhoto for the disk it came on, update to 6.0.5 and then repair disk permissions again. If you do try a reinstall of iPhoto you'll have to delete the current application and all files with "iPhoto" in the file name that reside in the HD/Library/Receipts folder.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.

  • Photomerge function does not appear in "File New" menu. Where is it?

    I cannot find the photomerge function in PhotoShop Elements 11. It used to be found in File > New > Photomerge, but now it does not appear there. Where can I fine it?

    In PSE 11 those have all moved to the bottom of the Enhance menu for some reason.

  • HT1619 menu does not appear when pressing the menu bottom from the apple remote

    I got a apple remote but the menu does not appear on the computer when pressing the menu bottom!?

    Prior to Lion, it used to invoke the menu of the FrontRow application.  FrontRow is no longer available with Lion.  The menu button will work with apple TV. 
    Regards,
    Captfred

  • HT1420 Authorize This Computer does not appear on iTunes Store menu

    Authorize This Computer does not appear on the iTunes Store menu

    You are looking at the Store drop-down menu at the top of iTunes, and not the iTunes store page ?

  • Calendar tab does not appear on Sun Convergence

    Hi;
    I have a problem.I installed sun communication suit 6 update 1.I have logged the system but does not appaer calendar tab on sun convergence.I don't solve this problem.How could i solve this problem?I see iwc log file.i see this warn.
    PROTOCOL: WARN from com.sun.comms.client.protocol.delegate.UserPrefsCommandDelegate Thread httpSSLWorkerThread-80-4 at 2009-02-25 15:24:36,632 - get_allprefs.iwc : Service is not enabled : cal
    PROTOCOL: INFO from com.sun.comms.client.entity.user.sun.CommsUser Thread httpSSLWorkerThread-80-4 at 2009-02-25 15:24:36,633 - SMIME Service is not enabled for server
    PROTOCOL: WARN from com.sun.comms.client.protocol.delegate.UserPrefsCommandDelegate Thread httpSSLWorkerThread-80-4 at 2009-02-25 15:24:36,635 - get_allprefs.iwc : Service is not enabled : smime
    PROTOCOL: WARN from com.sun.comms.client.protocol.delegate.agent.ClientOptionsAgent Thread httpSSLWorkerThread-80-4 at 2009-02-25 15:24:36,637 - client preferences not found for domain: <domain name>
    Help me..
    regards.
    thanks all..

    [email protected] wrote:
    I installed sun communication suit 6 update 1.Did you install Communication Suite 6 update 1 on a Solaris or Redhat Linux system?
    I have logged the system but does not appaer calendar tab on sun convergence.What mechanism did you use to create the user (e.g. Delegated Administrator GUI)?
    What service package did you assign to the user e.g. mars, earth?
    Do you see the Calendar Tab for the user if you log into Communications Express?
    I don't solve this problem.How could i solve this problem?I see iwc log file.i see this warn.
    PROTOCOL: WARN from com.sun.comms.client.protocol.delegate.UserPrefsCommandDelegate Thread httpSSLWorkerThread-80-4 at 2009-02-25 15:24:36,632 - get_allprefs.iwc : Service is not enabled : cal The user in question doesn't appear to have the Calendar Service assigned. Please provide an LDIF of the users entry from the directory server.
    Regards,
    Shane.

Maybe you are looking for

  • I have a balance in my iTunes account but would like to pay by credit card. How do I do that?

    How do I pay by account's credit card instead of balance in my credit from gift card?

  • Product group creation error

    Hi Guys, While creating product group i am getting the following error can any one help me out to resolve the same The error Required parameters missing when calling up module Message no. M3749 Thanks and regards Thamizhchelvan G

  • Real Time Communication

    HI Gurus, Can any one tell me what is  REAL TIME COMMUNICATION. Also I request information / details on RTCIS. Regards Ajoy

  • Webdynpro Database Error

    Hi, I have deployed compliance calibrator 5.2 webdynpro on Web AS Java 700 SP10. The database is SAP DB on windows 2003. I have followed the installation document and after deploying the ccappcomp file and all other files.I have restarted the server

  • Essbase PERL module

    Hi,Anybody installed succesfully the Essbase PERL module located in {arborpath}\perlmod directory?Is it possible to install it without Visual Studio compiler and Make.exe (or NMake.exe).Any way of doing it differently?Any ideas or thought about it? F