.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

CQWP results show only in Edit Mode

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :SharePoint


I added a CQWP to aggregate all Tasks within my site collection. It all works fine in Edit Mode and the correct tasks are displayed (it shows only the current user's uncompleted tasks).

However, as soon as I Exit Edit Mode the results disappear and the Content Query Web Part tells me "No items available". I switch back to Edit Mode: the items re-appear.

Any ideas what I am doing wrong?

View Complete Post

More Related Resource Links

Want to show FormView in Edit mode with specific table columns depending on their Genre??

hi, I have  a table in my database called "Profiles". This holds data on Female and Male personal characteristics. On my aspx, I have a formview in edit mode which is binded to an object data source with a GetDataByUserId Select method which retrieves data from the "Profiles" Table via a DAL. The "Profiles" table has some columns which relates to females only and some just males and some are generic to both. See example below     UserId - / of Type GUID GenreId /  of Type BOOL. Hip Size (For females) Dress Size ( For Females) ChestSize (For Men ) TrouserSize (For Men) Weight ( For both )   When the User logs in , they go to an update Page which has the Formview in Edit Item Mode and contains drop down Lists which are binded to the Users Selected Value. The DDL are in turn bound to their related table such as HIP, Dress, Chest, Trouser etc. Objective If a female user logs in I just want to show them the (Hip Size) DDL  and DressSizeDDL in the Edit item template of the formview and not the ChestSize DDL or  TrouserSize DDL. At present the GetProfileByUserId returns all colums from the table My question is how do I do this and just show DDL which are relevant to the Female or Male Only. In some cases the user may not have selected an item in the previous form so they could also be

How to show column value in display mode and hide in edit mode?


How to show column value in display mode and hide in edit mode for my custom page layout?

I need similar functionality like PublishingWebControls:EditModePanel with contrary behavior.

I cannot use nor server-side code neither third-party web-parts. Only pure APSX+SP Contol Libraries and client JS allowed.

How can I prioritise search results to show where document metadata has a hit first and then where t


When my users run a search against a site with a bunch of document libraries they will often search for terms that are in the title of the doc, if they do know the title they will put that in. What I would like to do is have the results ordered such that if any hits are on the document metadata (eg Title) then they are presented first and any results that are from hits on the content of the documents are presented later.

So, if they get the title spot on in their search query that document will appear first .... if they don't get it right then the likelyhood is that the title is something like what they entered so similar titled docs are presented first and then those with matching content ....

How can I achieve this?


Moved from WinXP to Win7 - don't see choice to open file in read only or edit mode


I just recently moved from Win XP Pro SP3 to Win 7 32-bit Pro. I am logging into domain X normally. Our Sharepoint 2007 server authenticates only on domain Y. So I start Internet Explorer with "run as different user" and provide my domain Y credentials. All fine. 

In win XP, after I did this, when I click on an Excel file on Sharepoint, I would get a dialog asking if I wanted to check out and edit or open as read only. 

In win7, I don't get that choice. The file simply opens, and I get a bar at the top which allows me to check out the file if I wanted to. 

How can I restore the functionality I used to have, with the dialog for checking out the file before opening it?

Show data in RowEditing mode


hello ,

        I have show data in gridview. when search item. And for updating We use Edit button. When I click on edit button it doesn't show data. I have also bind again data. It doesn't show data . The gridview doen't display.

        but When I enter search number again then display it.

I have paste some code snippest.

protected void gvFaxValidation_RowEditing(object sender, GridViewEditEventArgs e)

         gvFaxValidation.EditIndex = e.NewEditIndex;

         GridViewRow editingRow = gvFaxValidation.Rows[e.NewEditIndex];


         if (ddlSearchCriteria.SelectedValue == "PRESCRIBER_ID")

             gvFaxValidation.DataSource = objMasterBLL.FaxSearch(Txt_Search.Text);


SPDataSource returning 0 results when used in CrossList Mode



I'm writing a web part in C# to query several document libraries, using a SPDataSource with the results going to a SPGridView.

I got the query to work just fine with a single document library, but when I switched the SPDataSource to CrossList mode (and added the "Web" and "Lists" tags to the query), I end up with no results. I've done a lot of digging around on the web for examples of how to do this correctly, but always end up with the same result, no hits.

These are the only properties I'm setting on the data source:


ds.DataSourceMode = SPDataSourceMode.CrossList;

ds.UseInternalName = true;

ds.SelectCommand = queryString;

The query string looks like this (I added the formatting for readability... the actual query string is all a single line):

<Webs Scope='SiteCollection'></Webs

Not always prompted for read-only or EDIT mode, when opening files with IE7, Sharepoint 3.0

Hello Everyone,   We use Sharepoint 3.0 and when I click on a document I get a pop up prompt that asks me whether I want to open the file in READ-ONLY or EDIT mode.   I use a machine with XP Pro that is running IE7.   A user called me today, also running IE7, and when he clicks to open a Sharepoint file he gets a different prompt - a simpler one that just offers OPEN or SAVE.   I don't care that his prompt looks different - the problem is that he is able to open the file, make edits, but then when he closes the file (using Excel) he isn't able to save his changes.   Excel only provides a save-as option for him.   This isn't a permission problem with his ID.   When I login to our Sharepoint 3.0 system as him, with his password (from my machine), I get the usual Read-Only / Edit prompt and when I open a file in EDIT mode I am able to save my changes with no problem.   Any thoughts on this?   Chris

Accessing a row's dropdownlist values AFTER the gridview control is in Edit mode

Hello, I have a gridview control. When it goes into Edit mode, there are 3 dropdownlists in one cell that are populated by separate stored procedures during the RowDataBound event. The 1st dropdownlist's value is used as a parameter to determine what the 2nd dropdownlist is populated with. The 2nd dropdownlist's value is used as a parameter to determine what the 3rd dropdownlist is populated with. Everything works fine when the row is first put into Edit mode. While I'm in Edit mode and I change the selection in the 1st dropdownlist, how do I access the control so I can feed this new parameter to the 2nd dropdownlist? I have the first 2 dropdownlists set for AutoPostBack so that the Page_Load event is fired when the user changes a value. I know how to get access to these controls via the FindControl method when the row is being databound but how do I find the control during the Page_Load event? Thanks for any help!!!   Penny  

Unable to Show Edit item Links in Data Form Web Part

I have a DFWP connected to custom list and the boxes to Show Edit Item Links, Show Delete item links and Show Insert Item links are grayed out so that they can not be checked. This works fine when I use a DFWP connected to a standard list (i.e., Contacts). Is there something special that needs to be done to activate this functionality?ThanksDean

Site Pages don't show up in mobile mode

In Site actions, I get the regular URL and the Mobile URL - - I've created several aspx pages with aspx controls on them. Two pages have dropdownlists, textboxes and gridviews. One just has a regular HTML table with aspx buttons, with postbackurls. Any list I create shows just fine, but none of the content in my aspx pages show up in mobile mode. I can get a list of the page names (with the extensions) when I click on 'view All Pages', however, when I click on the links, the content in the page does not show. What are we supposed to do for pages like these, for mobile mode?

Need more font size options in browser edit mode

Is there a way to have a different font size other than the drop down menu of Editing Tools > Format Text of: 8, 10, 12, 18, 24, 36, 48, 72 pt ?   As a designer, I feel handcuffed with just these options. 

Gridview edit mode - What event does enter key call?

I have sort of a very specific problem.  I have a gridview with a few different template columns and a commandfield with the standard "edit" link.  There is no sqldatasource associated with it at all.  In the code, I pull some data from an sql database into a datatable and set the gridview's datasource to be the datatable.This all works fine.  When I hit the "edit" button, the standard textbox shows up where it needs to so that I can edit the data.  The problem is the updating portion.  I have programatically removed the "update" button and left the "cancel" button for design reasons. I want the user to be able to hit "enter" in order to update the data in the data table.  Then, when they're ready, they can click a submit button which will extract the data from the datatable and update the database.I'm having trouble with this 'enter key' business.  When you edit the data and hit "enter" while in edit mode, the page posts back, and the previous values are placed in the gridview.  What event was just  called?  I need a way to take what the user put in and place it in my datatable.  What are my options?Thank you. 

Show last edit user for views

Is it possible to record down the last userid that last edit the view?

Content Query Web Part (CQWP) fails to show picture items from a document/picture library in an anon

I have a Picture Library and am trying to use the CQWP to display a list of items in the library.  The web part shows the items fine in authenticated mode, but it fails to show the items to anonymous users. The error log message is: Error while executing web part: System.NullReferenceException: Object reference not set to an instance of an object.     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.SetDocumentIconUrlAndOnClickString(SPWeb web, DataRow row, String strDefaultItemOpen, Boolean fSetDocIcon, Boolean fSetOnClick, String fileRefColumnRef, String progIdColumnRef, String fsobjTypeColumnRef, String permMaskColumnRef)     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.PreProcessForDocumentIconAndOnClickAttribute()     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.AddContentQueryData()     at Microsoft.SharePoint.Publishing.WebControls.ContentByQueryWebPart.GetXPathNavigator(String viewPath)     at Microsoft.SharePoint.WebPartPages.DataFormWebPart.PrepareAndPerformTransform(Boolean bDeferExecuteTransform) I'm running SP 2010.  I've tried various scenarios including: 1. Using the default publishing template. 2. Using the blank site template with publishing and lock down features enabled. 3. Us

Why does the Search Results show the wrong Title?

All my documents have the Title property set, yet when I perform a search, the result result is displaying the first word it finds in the documnet as the Title? For example I have many documents all with unique Titles, yet each of the results show "PROFILE" as the Title of the document because it is the first word in the document..... PROFILE end and the middle tier of the application using C#, ASP.NET, WCF and SQL Server backend. … and facial recognition technologies using C#.NET for Microsoft .NET framework 1.1 and 2.0. … Authors: Brian Shome Date: 8/12/2010 Size: 111KB PROFILE The application was developed using ASP.NET 2.0, C#.NET and SQL Server 2005 served as the … to the end user. He used VS.NET 1.1, C#.NET 1.1 with Microsoft SQL Server 2000 and Oracle … Authors: John Doe, Jxibbons Date: 8/12/2010 Size: 117KB PROFILE The technologies used for the application are C# 2.0, ASP.Net 2.0 and SQL Server 2000. … developed this application using ASP.Net and C# and the backend comprised of both Oracle and … Authors: Paul Scot, Gen Gotti Date: 8/12/2010 Size: 110KB

hide EDIT mode from the ribbon

Hi, I am creating a page in SPD 2010 contain custom form that insert items in a list (Poll).  the problem is when i browse the page, by default the ribbon goes to the edit mode. please see the snapshot http://www.exceeditacademy.com/pdf/issue.jpg my question is: - how to force Ribbon to go to the browse mode dirrectly ? or - How to hide the edit mode from the ribbon ? thx

Have templatefield in edit mode and datasource defined in code behind

Is this possible? Some sample code:<asp:GridView ID="gvConcerns" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None"> <RowStyle BackColor="#EFF3FB" /> <Columns> <asp:TemplateField HeaderText="Number" Visible="true" SortExpression="Number"> <EditItemTemplate> <asp:Label ID="lblEditNo" runat="server" Text='<%# Eval("number") %>'></asp:Label> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Part" Visible="true" SortExpression="part"> <EditItemTemplate> <asp:Label ID="lblEditPart" runat="server" Text='<%# Eval("part") %>'></asp:Label> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="List" Visib
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