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

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

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

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :SharePoint
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

View Complete Post

More Related Resource Links

Applying custom CSS to the MOSS 2007 Calendar control Month view



I have a requirement to use the MOSS 2007 Calendar Control - month view is to apply a custom css to have a look and feel as per our requirements.

We tried applying the custom css to the MOSS 2007 calendar control - month view, it does take the custom css and applies it, but when i click on any date and come back to the calendar control, it changes the CSS of the MOSS calendar control back to the default one.

Let me know if anyone has any suggestion on  how to customize the calendar control for css for our intranet application.

Your response would be highly appreciated.






Adding ListViewWebPart to a page - how do you set its view to

If you add a ListViewWebPart to a wiki/web part page (such as the Links list), it will default to the <summary View>.  If you add it using code, it will default to the default view.  How can I set it to use the <Summary View>? I tried setting node.Attributes["BaseViewID"].Value = "0" in the web part view xml, but that didn't do anything. Any thoughts? ListViewWebPart wpLinks = new ListViewWebPart(); SPList listLinks = site.Lists["Links"]; wpLinks.ListName = listLinks.ID.ToString("B").ToUpper(); wpLinks.ViewGuid = listLinks.DefaultView.ID.ToString("B").ToUpper(); AddToolBar(wpLinks, "Add new link"); private void AddToolBar(System.Web.UI.WebControls.WebParts.WebPart wp, string label) { // Get the view used in the web part by using reflection PropertyInfo viewProp = wp.GetType().GetProperty("View", BindingFlags.NonPublic | BindingFlags.Instance); SPView webPartView = viewProp.GetValue(wp, null) as SPView; // This is necessary after the infrastructure update, without it you can't get to the XML of the view webPartView.GetType().InvokeMember("EnsureFullBlownXmlDocument", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod, null, webPartView, null, System.Globalization.CultureInfo.Current

Creating calendar view from tasks list programmatically

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.

Remove Saturday and Sunday from Calendar Web Part View MOSS 2007



Is there a way to remove Saturday and Sunday from the default calander web part view.  I need to get my calendar to fit in a 800x600 window, so users do not have to scroll.  I would just like for the calendar to show Monday through Friday.

Data View Web Part, update to Data Source / adding new list to existing data source


Hi all,

I have four Lists with identical columns :

List 1
List 2
List 3
List 4

I had to merge them, hence i created a data source ( Linked Source ) and merged these lists in SPD. I have used a data view webpart to display some columns from the merged lists data source and everything was working fine.

But now i have a new List : List 5 which also has the same columns like the other four lists and i need to update the data soure such that it is merged list of 5 lists not 4.

i updated the datasource property of the linked source to merge this new list as well. However the contents of List 5 dont appear in the data view webpart. 

Am i missing something here ? 

I dont want recreate the data view web part from scratch eachtime , because in future there might be List 6 , List 7 as well ... 

Custom List Form web part connection to data view


We have a sharpoint site to manage "projects".    That site includes a document library.  The documents uploaded to the library are categorised based on the project they belong to.

We are trying to implement a custom list form for editing a project record that does one of the following:

1. When the edit form is loaded for a particular projects record that edit form also shows a list of relevant documents.


2. Include a button or link on the edit form to another page that lists only the documents for the current project.

We thought this would be easy to do using web part connections.  If we click on the custom list form it gives us the option to setup a web part connection.  However, if you follow this wizard through and get to the stage of selecting columns to link, there are no columns listed for either the custom list form or for the target dataview.  This is the case whether the target data view is on the same page, ie in case of option 1 or on a different page as in case of option 2.

Could someone advise us how we could either get the web part connections between the custom list form and other dataviews to work or how we could hyperlink to a dataview and pass the id of the record currently being edited to that dataview as a filter?

We are using Sharepoint Designer so would appreciate any suggestions base

Custom Control Design view error



I have created a custom control from scratch and it works fine as in you can build the project that uses it and it works fine at runtime. Problem is when you go to design view the control shows an error in the place of where the control should be rendered.

Error: '<SomeValue>' Could not be set to '<SomeProperty>'

This shows up on all my custom set properties. These properties are created as basic as possible. I can give the properties values in Source view and run the app just fine. I can even add a Onclick event. If I don't set any custom properties the control will render fine in Design view. It's only when I set a value to a custom property.

Property Code Example:

public string Text
                string ret = "";
                object obj = ViewState["Text"];
                if (obj != null)
                    ret = obj.ToString();
                return ret;
                ViewState["Text"] = value;

I've even removed the Category and Description tags with no difference.

I don't know if what I said makes sens, but I hope it

Custom Grid View Header - Grid view Row Created event vs Gridview row databound events ?


Hi Gurus ,

It happened to add an extra Gridveiw Header in row_databound event , It did worked fine on !Postback but disappered on Page.Postback . Quick google search guided me to move the event to Row_Created event and every thing is okay .

Can any expert post some pointers , differnces between grid row_created vs row_databount with some sample table data created dynamically  behaviour of both the events in !Postback and page.Postback .

Thanks a tonne in Advance and  any inputs will be valued and appreciated .

Custom tree view for navigating wiki pages

I'm creating an information resource on our intranet (WSS 3.0) using the wiki style format.  The only trick is, unlike a standard wiki, where all pages are directly under the parent, I want to be able to create a customizable tree view where some pages are nested underneath each other.  For example, this particular site talks about all of our different IT systems.  I'll have a wiki page for each system, then underneath each of those pages, there will be more pages for things like training, documentation, etc.  Even though all those pages are at the same level, I need to be able to nest them in a navigational tree view on the quick launch bar.  I suppose if there were also a way to nest the wiki pages themselves, I could just use the pre-packaged tree view.  Anyone have any ideas?

Add page numbers for paging in data view web part


Hello all,

Has anyone found a solution that will allow me to have page numbers for paging in a data view web part. For instance, if I have 40 items/rows and I set the paging to display 10 items, I'd like the paging to show 1 2 3 4 rather than showing 1-10 and having to click next over and over to get to a specific item.

I found this article, but it is for 2003 and doesn't seem to apply to 2007 or if it does I am not able to really figure out how.


Please help!

Thanks in advance.


Adding ContextMenu to WorkflowDesigner View

Hello Everyone,      I am trying to add the ability to have a user highlight an activity subtree, then right click the mouse, then select "Extract activity".  Which will then take out the xaml (ModelItem) selected, create a new activity out of it, then insert this newly created activity in its place.  Right now I'm stuck on getting a ContextMenu to appear when I right click in the designer area.  I can get my custom context menu to work in other places on the same window however.  Does anyone know the solution to this problem?  Also, does anyone have any better suggestions as to how I might achieve the same end result in a more efficient manner? Thanks everyone, Bob

Customize calendar to view next month

I was wondering if there is a way to change the calendar view on SharePoint so that it defaults to next month.  Will I have to create a custom web part for this functionality or can I create a view and manipulate it with filters? Thank you in advance.

stsadm export / import custom view / personal view views

Hi, i have to export and import a website with a sharepoint list including all personal views. The personal views are used by the endusers in excel data connections binded to the list.  Loss of personal views during import is not mentioned in the technet discription of export / import command ( http://technet.microsoft.com/en-us/library/cc766807(office.12).aspx  ) I am actually testing the export / import between two site collections, but always losing the personal views (MOSS 2007 with CU April 2010). This discussion had the same topic http://social.technet.microsoft.com/Forums/en-US/sharepointadmin/thread/4e299838-72c2-4f56-8dc3-05ba2a2999d9  but with no definite answer. Please tell me if this is by design or what could cause this behavior. Thanks in advance. Boris Boris Schlotthauer

Displaying Calendar Description Field In Calendar View

In the default "out of the box" calendar view it only shows the Title of a calendar event. Is there any way to show not only the Title field but also the Description field?

Calendar and grouped view causes errors

Hello, I've come across a bizarre situation on a standard web part page. First I add a simple (or so I thought) document library web part with a view grouped on a column. The view is collapsed. Then, I add a calendar view to a page. Immediately, my grouped doc lib view turns into a site navigation web part with no resemblance to the doc lib. If I change the doc lib view to a non-grouped view, all is well again. I've built three different pages on different sites and can re-create this problem every time. If I change the Calendar web part to a detail rather than a calendar view, the page goes back to normal. Any idea what is going on here or how I can mix a calendar and a grouped view on the same page?   Thanks.

Remove time from Month Calendar view

We have a calendar part on a page that has very narrow boxes for each day. As such we want to remove the time from appearing before the title of the event. I have managed to do this through css where there is only one event. However, have not been able to remove it where there are mutiple events. Any ideas on how this can be removed in both scenarios? Cheers, Theo

Group by library name using Data View Web Part

I'm using a data view web part to disply documents in multiple libraries.  Is it possible to group on the name of the library instead of grouping on an individual column? Thanks
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