.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Creating calendar view from tasks list programmatically

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :SharePoint
Hi All, I have a Tasks list of type "107" and I am trying to create a Calendar view for the tasks list. The way I created the calendar view is as follows: SPView calView = l.Views.Add("Calendar", l.GetView(l.DefaultView.ID).ViewFields.ToStringCollection(), string.Empty, (uint)100, true, false, SPViewCollection.SPViewType.Calendar, false);<br/><br/> I would like to specify the Time interval, Calendar columns, Default scope for this view. Can anyone point me to documentation for creating a calendar view from tasks list? Do I need to specify that in the viewquery?Thanks.

View Complete Post

More Related Resource Links

Connect "Project Tasks" List's Calendar View to Outlook


I would like to connect our department's "Project Tasks"-type list to an Outlook calendar (the same way I can do with a "Calendar"-type list).  

In Sharepoint, I have a nice "Calendar View" (this is a Sharepoint View/Report using the "Calendar" format) of the "Project Tasks"-type List items showing which items were worked on in the past or are to be worked on in the future.  I would like to Connect this view to Outlook, but it appears this "Project Tasks"-type list does not have the "Connect to Outlook" option in the ACTIONS menu.  

I have confirmed that the "Connect to Outlook" option is activated in our "Enable Client Integration" settings per thread ((http://www.eggheadcafe.com/community/aspnet/69/10091824/cannot-see-connect-to-outlook-in-the-actions.aspx).  In fact, if I create a strict "Calendar"-type list (instead of a "Project Tasks"-type list or "Issue Tracking"-type list), I do get the "Connect to Outlook" option in the ACTIONS menu.  I'd li

Programmatically creating a cross list XsltListViewWebPart

Hi, Does anyone know how to create a cross list XsltListViewWebPart in code? I can create a XsltListViewWebPart for a single list no problem. But if I don't set the ListId property and set the DataSourceMode to  SPDataSourceMode.CrossList I always get the error "Microsoft.SharePoint.WebPartPages.WebPartPageUserException : List View Web Part could not be added, list may be hidden.". I can't find much documentation on it. Does anyone have an idea how to get this to work? Thanks a lot,   Dan

Programmatically adding Calendar web part with summary view or custom view?

Within my feature I am adding a calendar web part to page.  I would like to specify the summary view (not the full graphic calendar view).  Is this possible? Is it possible to create a custom view and set the listviewwebpart to this custom view through code?   thx -davedave

Creating a Calendar view that only shows weekdays.

I've been trialling SP2010 for a little while now, and it looks great. In developing an Intranet, I would like to create a couple of custom views. A weekly calendar view that shows THIS week, in a day-by day format, that only shows monday to friday, with a 1-2 line summary of every entry A way to show on the same page, or link to NEXT week, that shows a similar view We currently have an old/manual Intranet setup that displays the current week + next week, on the same front page, so that Staff can see, at a glance, everything happening in the 2 week period (which is as much information as they want!) Being able to eliminate Weekend from the view is the most important bit, as it enables a bit more room on the screen, and since it's a school, nothing is ever on the weekend anyway! I found a few bits of js code, that are meant to work with WSS2007, but I couldn't get them to work in 2010 (I'm guessing quite a lot has changed) Thanks, Rohan

how to display multiple calendar list data in single calendar view

Hi, Normally, we can used to extend the ListViewWebPart's ViewType property to display a particular calendar list items in Calendar View in our custom webpart. Is it any way to display multiple calendar list data in a single calendar view ?? or please provide some pointers related to this issue. Any help is much appreciated.    

Calendar View for External Data List in SharePoint 2010?


I'd like to create a calendar view from data contained in an External List.  My external content type has a Start Date, End Date, and other calendar fields.  Is this possible using the out of the box BCS?

For extra credit - I'd like to then use this calendar as an overlay on other calendars within my SharePoint 2010 application.

Thanks for your help!

Creating a Custom View for a Custom List


I have been thrown in head first to MOSS 2007 and am trying to learn it as fast as possible. Here is what I got:

A custom list that is populated from an external database by a timer job every minute. There is also another job that clears items in that list that are over an hour old.

What I want to do is, create a view/web part that essentially shows a gridview with certain columns from the list. Also need a column that is calculated on the fly, and is not in the list (basically create a hyperlink to another site based on a column in the list).

I also need 2 buttons or something next to each row that will allow me to manipulate that row. And I need that list to autorefresh every few seconds to reflect changes in the list.

What would be the best method to do that?

Calendar List View Issue - No Month, Week, Day Icons


I'm trying to setup a Calendar view for a list in SharePoint 2010. Everything is working the way I want, except there are no icons to change the view from Month, Week, or Day. Right now, if someone clicks on a date on the calendar, it switches to the Day view. But there is no way for them to go back to the month view.

I open the page in SharePoint Designer, and in the Design view I can see three icons on the Calendar (Month, Week, Day). But at no time do these icons show up anywhere except the design view.

I want it to have the arrow buttons, the month and year (which are already displaying) and then the icons to change the view. How do I get them to appear?

How to set OrderedView of the list view programmatically



I am trying to modify the List View of Link list in SharePoint 2010. What I need to do is to allow/disallow users to order item of Link list programmatically. We can do this easily using SharePoint browser.

How to do this using SharePoint UI.

Goto List->Modify Views. There is "Sort" option "Allow users to order items in this view? ".

But I need to do this programmatically and the accessor "SPView.OrderedView" is read only so I am struck.

I can however change the sorting columns using CAML.

Any suggestion will be greatly appreciated.


Prakash Tandukar


Export SharePoint List to Excel Spreadsheet Programmatically using C#

In SharePoint applications, Custom Lists are used to store business data and Document Libraries to store the documents. But for data manupulation and analysis, Microsoft Excel provides very rich features as compared to SharePoint Lists. That's why people still loves to work on Microsoft Excel Sheets.

Creating an Excel Spreadsheet programmatically using VB.NET

The Interoperability services make it very easy to work with COM Capable Applications such as Word and Excel. This article reveals using Excel from a managed application. Excel is the spreadsheet component of Microsoft Office 2000. The majority of Excel programmatic functionality is exposed through Automation via the type library Excel9.olb. The intention of this article is to express that a managed application can interrelate with Excel as a COM server.

Creating an Excel Spreadsheet and Adding Data to It Programmatically

The Interoperability services make it veryeasy to work with COM Capable Applications such as Word and Excel. Thisarticle reveals using Excel from a managed application. Excel is thespreadsheet component of Microsoft Office 2000. The majority of Excelprogrammatic functionality is exposed through Automation via the typelibrary Excel9.olb. The intention of this article is to express that amanaged application can interrelate with Excel as a COM server.

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

Disable filtering on a Dynamic Data list view.


I have an entity set of NotificationTemplates, and each one of these has a collection of zero-many SmsTemplate entities. When editing or viewing a NotificationTemplate, I have a link to View SMS Templates. That link takes me to a List view for the SmsTemplates entity set, filtered for the NotificationTemplate I was viewing.

How can I prevent the user changing this filter to show SmsTemplates for another NotificationTemplate? That is, I want the filter, but it must be read only. The drop-down just mustn't drop down, it must just display the name of the NotificationTemplate that these SmsTemplates belong to. To view SmsTemplates for another NotificationTemplate, the user must click View SMS Templates from that other template.

This was originally asked by myself on SatckOverflow at: http://stackoverflow.com/questions/3514373/disable-filtering-on-a-dynamic-data-list-view

Creating Reorderlist Programmatically


I hope to get some guidance on how to create reorder lists programmatically because of the situation described below. Thank you.

I have a page where I want to have a toDo Iist for each of several (typically 10) milestone categories. I can think of 3 options.

I don't know in advance how many 'active' categories there will be but I there is a known fixed total of about 20  categories, of which from 1 to 20 may be 'active'

1. Have one Master ReOrderList And Then Nest the Category ReorderLists Inside 

2. Create the reorderlists programmatically.

3. Brute force approach. Hardcode all 20 reorderlists and their associated sqldatasources, and then set visibility

depending on which category is active. This approach is the simplest but has the disadvantage of too much

repetitive code and the reorder lists would be in a fixed order, when I really want them to match the category order.




ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend