.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

The specified view is invalid for web part created during feature activiated

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :SharePoint
I have some code executing during the Feature Activated event. During this process, I try to insert a list view web part into a page, setting the viewGuid to a custom view already created. But I keep getting the error about the view being invalid. After the feature is activiated, I go through the UI and select the view and the web part uses it just fine. What is going on? Does anyone have a thought, link to answer? I'm sure others have come across this before.

View Complete Post

More Related Resource Links

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 .

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.


Deactivating web part feature in sharepoint

Hey guys. I've developed a web part using the wspbuilder tool (Web part with feature). When deployed (to a site collection), you have to activate the feature in order to use this web part - so far so good. However, when deactivating the feature, the web part remains on any site where it's been added, and furthermore, it's still available in the web part gallery? Is this expected behaviour? Is there no way of removing the web part from all subsites in the site collection, and also remove it from the web part gallery? Thanks ;)

The specified view is invalid error when browsing for images

Hello All, Currently using MOSS 2007 publishing site and using the CMS elements to publish content to the web.  One of our users is experiencing a strange problem whereby when they try to insert an image into the Sharepoint content editor using the Insert Picture functionality they get the following error when trying to browse to an image: The specified view is invalid.   at Microsoft.Sharepoint.SPViewCollection.get_Item(String strDisplayName) at Microsoft.Sharepoint.Publishing.Internal.States.AssetPickerDetailState.InitGridView(GridView grid) at Microsoft.Sharepoint.Publishing.Internal.States.AssetPickerDetailState.Configure(SMObjectList objectlist) at Microsoft.Sharepoint.Publishing.Internal.WebControls.SMObjectList.Handle_LoadCompleteEvent(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Page.OnLoadComplete(EventArgs e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) Only one user is experiencing this problem, others are fine. Does anyone have ANY ideas what is causing this issue or how to fix it? Thanks

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

How to hide the list ribbon in XSLT List View Web Part?

Hi, In SharePoint 2010, I have a custom list "Clients" on a site. On the home page of the site, I have added a Clients List Web Part. When I access the home page in a browser and click anywhere in that list, it displays the "List Tool" ribbon group which has "Items" and "List" ribbons. I do NOT want these ribbons at all when clicking on the list. How do I achieve this? Should I disable the click event on the list so these ribbons do NOT appear? How do I disable the click event on the list? Or What should I do to hide these ribbons when clicking on the list? Basically I want it to behave same as content query web part. In content query web part, if you click anywhere in it, it doesn't show up any extra ribbons. I want the same behavior with list web part. Thanks, Hitesh

How to remove Title, Created By etc from Document library view?

How to remove title of columns of the Document Library/Links/Annoucements so that only WebPart Title and items are displayed?Kenny_I

Why do we need Common view fields in content query web part?

I am a bit confused on the purpose of "CommonViewFields" in CQWP. Almost all the write-ups on the web says that if we need a custom column to be available in the web part's XSL, we need to export the webpart file, add the columns to "CommonViewFields", import the web part to the site. However I noticed that, when I create a custom style template in my "ItemStyle.xsl" and simply add a line like <xsl:value-of select="@MyCustomColmn"/>, then "MyCustomColumn" appears automatically under "Fields to display" in the tool pane as a text box prompt, when I edit the web part and select my style template. I can then simply fill-in my column display name under "MyCustomColumn" and the web part works perfectly fine. (There is NO NEED to export the web part, edit the ".webpart" file and add "commonviewfields" etc..etc..etc) If this works, then what is the real need for "commonviewfields" ? Can someone shed light on this? I am totally confused.. (SharePoint 2010)          

Web Part on View Form Hides Ribbon

If I add a web part to a list or document library view for - say 'AllItems.aspx', the 'Library Tools' ribbon section is hidden.  Is this intended behavior or is there some configuration setting I am missing? To reproduce: Create a new Document Library Edit the default 'AllItems.aspx' view page Add a web part (any WP seems to do it) Exit edit mode Only the 'Browse' tab is now available

In data view web part - how to display document name with link that opens lookup document rather tha

I have a list with a lookup column to create relationships with documents in a separate library. I am creating a data view web part to display each item in the list. One of the fields I want to display is the document field (the lookup column). I want this to be in the form of the related document's name with link to directly open the source document itself (Word, PPT, ...). Now I am only managing to display the document name linked to opening the document's display form of the related document library, and then I have to click the document's name there to open it. Alas one unnecessary click too many. Any wize tips? Henning

Displaying a count of records in a Data View Web Part outside the web part itself?

I have a DVWP with 400 rows. I have these inside a Div tag, which makes it scrollable. I also have several URL filters set up to show certain records. I would like to add the count to the page to display the number of records when the filters are activated. I have added the View Footer to the DVWP but this just gets placed at the bottom (still inside the Div tag). It would also be cool to be able to do counts with criteria so I could do comparisons (ie, 50 records overdue/400 total etc). Thanks

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

format-number issues with the Data View Web Part in SharePoint 2010

I have a number column named @Year_x0020_1_x0020_Revenue in the data view web part in SharePoint Designer 2010. In the Xpath expression builder - @Year_x0020_1_x0020_Revenue previews "500,000" If I use the format-number in the Xpath expression builder ==> format-number(@Year_x0020_1_x0020_Revenue, '$#,##0.00;-$#,##0.00'), it returns NaN. Is there any reason? 

Data View Web Part in SharePoint Designer 2010

Is Data View Web Part (aka Data Form Web Part) in the SharePoint 2010 has changed from the SharePoint 2007 or Is it working differently in the SharePoint Designer 2010? In SharePoint Designer 2007, whenever you have data view web part on the page, there is little handle to click on the top right of the data view web part to show Common Common Data View Tasks. Also for each cell, there was a handle to show xsl:value-of tasks which was great for formatting. Is that option is gone in the SharePoint Designer 2010?

can not change view of list view web part

hi, i created a list view web part and tried to change its view to custom view. in following code the view gets created but never comes as default. i have to go to list view web part and change it manually....                       web.AllowUnsafeUpdates = true;                     ListViewWebPart lvwp = new ListViewWebPart();                     lvwp.ListName = list.ID.ToString("B").ToUpper();                     SPView view = list.Views["customview"];                     view.Query = query;     view.Update();                     lvwp.ViewGuid = view.ID.ToString("B");                     lvwp.Visible = true;                     web.Update();                     web.AllowUnsafeUpdates = false;   I even tried with SPLimitedWebPartManager as shown in some example....                    &n

Using a List View web part to display documents from multiple document libraries from different site

Hi there, I am trying to have one web part display documents (or list items) from different document libraries (or different lists) from different site collections. I have achieved this under a single site collection using Data View Web Part (using SPD). I have also achieved displaying a single document library (or a list) from a different site collection by using List View Web Part. but I am not sure how to get my head around displaying documents or list items from different document libraries or lists across site collections. I have thought of using SPSiteDataQuery or ListViewByQuery, but they all seem to focus one site collection at a time. If any of you have done this before, please share your best practice on this one with me. Much appreciated. Clark

data view web part - read and write using web service

Hi I am looking for an example on "Data View Web Part" in WSS 2010 to read and write data from a web service that I have written and then update the database. or if you have a any better way of doing this function of reading and writing data to and from "Data View Web Part" in WSS 2010. Thanks heapes in advance. Kind Regards,  sword
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