.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

how to make webpart only show top list item?

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :SharePoint
Our office is new to SharePoint (including me!).  On our new SharePoint intranet I want to create a SharePoint Tips list.  I then want to put a WebPart on the home page that only shows the most recent tip added to the list.  I can't figure out anyway to configure that.  Thanks for suggestions.

View Complete Post

More Related Resource Links

radiobutton list item make visible true or false in javascript

in my project i have used one radiobuttonlist according different user login , i want to make one of radiobuttonlist item visible true or false..   please help me to solve this issue.   thanks in advance.  

Cannot enable Ribbon Edit Tab buttons and "connect" them to a list item in my custom webpart

I have one list with some custom fields and I want to develop a custom page. So, I created an ASPX page and added my custom webpart. This webpart has just a RichTextField, in edit mode, "linked" to one item of the list, like below: SPSite _SPSite = SPContext.Current.Site; SPWeb _SPWebProjects = _SPSite.OpenWeb("/Projects"); SPList _SPListProject = _SPWebProjects.GetList("/Projects/Lists/Project"); int _ID = Convert.ToInt32(this.Page.Request.QueryString["ID"]); RichTextField _RTF = new RichTextField(); _RTF.ID = "RTF"; _RTF.ControlMode = SPControlMode.Edit; _RTF.FieldName = "History"; _RTF.ItemContext = SPContext.GetContext(HttpContext.Current, _ID, _SPListProject.ID, _SPListProject.ParentWeb); _RTF.RenderContext = SPContext.GetContext(HttpContext.Current, _ID, _SPListProject.ID, _SPListProject.ParentWeb); this.Controls.Add(_RTF);   Then, I "turned on" the edit tab on the ribbon by doing the follow: protected override void OnPreRender(EventArgs e) { SPRibbon _CurrentRibbon = SPRibbon.GetCurrent(this.Page); _CurrentRibbon.TrimById("Ribbon.WebPartPage"); _CurrentRibbon.MakeTabAvailable("Ribbon.ListForm.Edit", string.Empty); _CurrentRibbon.MakeContextualGroupInitiallyVisible("Ribbon.ListForm.Edit", string.Empty); _CurrentRibbon.Minimized = false; _CurrentRi

Content Query Webpart to show edit item link field in SPS2010


I have a Content Query Webpart in SharePoint 2010 that I would like to surface Documents grouped by content type. I wish to show the edit form or view Properties link as part of the fields shown in the results. When the User clicks on this link, it should take him to the edit form or view Properties page for the document.

Any ideas?

How to change a SharePoint list item Approval Status from Silverlight webpart



I'm facing the following problem:

I have an embedeed silverlight xap application inside a custom visual webpart, that access SharePoint data through Microsoft.SharePoint.Client.Silverlight classes, and I have to modify some fields from an item from a list that has "Require content approval" enabled. I update the item successfully, but its approval status is set to "Pending" afterwards. 

How can I re-approve the content programatically?

Some additional information:

  • SPList item has a moderation information field, but in Silverlight there is only "ListItem" which does not contain such field.
  • When I try to do "item["_moderationinformation"] = something", I receive a PropertyOrFieldNotInitializedException.
  • I can check for Item.ParentList.EnableModeration, but there is neither a field nor a method related to moderation on the item itself.
A possible solution would be to create and call a web service that approves the items, but I'd rather prefer to avoid hosting and calling a ws to cover this functionality.

Any help on this would be greatly appreciated.




Column to show count of attachments uploaded for each List item in MOSS 2007


We have two requirements:

First, we need a column which shows the count of attachments that are for uploaded each item, the list structure is like below:

No. Of Files Attached Title Category Description Owner

List Item is not visible to specific users in a webpart in my portal



There is a webpart which is displaying the items from list.There is another webpart which also display same items as in the above webpart.

Issue: Now the issue I am facing that the list items are not visible to specific users even though it is visible to same users who are in the same group. But this issue I am facing in production environment but not in staging environment.

Your quick help will help us a lot.



How to make a sharepoint list column readonly or invisible while add/edit list item in sharepoint UI


 Hi Everybody,

I have created a list in sharepoint. In that list there is a field which I want to make read only or invisible when the user tries to add or edit a list item through sharepoint UI. I want this because that particular field gets populated through a webpart and direct data entry into that field is unnecessary. Is there any way to make a sharepoint column (for me its a picture column) read only or invisible in the sharepoint UI.

thank you,

Arun Dutt

Metadata properties set in list item, but don't show up in the DIP.


Hi folks,

I'm creating a document programmatically on the server side and using SPFileCollection.Add(...) to create it using the binary contents and a hashtable of the metadata properties.

This works great in SharePoint.  The SharePoint list item picks up the metadata properties and a new document item is created in the library with the proper metadata for all of the fields.  If I view the properties or go to edit the properties in SharePoint, all of the metadata is correct.

However, when I open the document in Word, it seems that none of the managed metadata fields (taxonomy field types) "stick".  The values are only for the managed metadata fields.

In SharePoint, if I change any of the fields and do a save on the list item and then open the document, the taxonomy fields "stick" when I open the document again.

I've opened up the document to view the XML and it seems that the custom properties XML doesn't change from pre-update to post-update.

I've also tried calling SPListItem.SystemUpdate(...) and SPFile.Update(), but this has yielded no results so far. 

So in summary:

  • All fields except for managed metadata fields "stick"
  • All fields show up fine in SharePoint in view and edit mode
  • Managed metadata fields are blank when Word document is open

Group By With Collapse="TRUE" doesn't show list item.


I created a SharePoint Page.  I then inserted an XsltListViewWebPart web part via SharePoint Designer 2010.  I then modified the CAML to include a couple of filters.  I then added a start date and end date parameter.  Then I saved my page and went into SharePoint.  I added two date filters (start date and end date) and I connected them to the  XsltListViewWebPart web part.  Then I selected a start date and end date and the list is correctly filtered.  The list is grouped by district and location.  However, when I expand the district and then I expand the location, it says "Loading...." but then it never loads anything.  If I change it to Collapse="FALSE" everything works fine???  Any help would be greatly appreciated.




         <FieldRef Name="Created"/>
         <Value Type="DateTime">{StartDate}</Value>

Show confirmation dialog on list item edit

When users edit a  list item and click o.k.  How can I show a dialog box to confirm ( yes / no) the change. 

Display single item from List using XSLT and show total count of all items in list


I have a simple SharePoint 2010 list named "Tips". Each item consists of a Title and Description. I want to display a single item at a time in a sidebar on my site with arrows to advance to the next or previous item in the list. I've been able to accomplish this pretty easily using OOTB SharePoint XSLT list view web part settings and AJAX. However, when I tell the web part to only display 1 item at a time the pager always says it's showing item "1 of 1" or "2 of 2". It won't show the total number of items from the list. I'd like it to show something like item "1 of 25", etc. How do I get it to display the total count of items from the list?  I've looked at possibly using aggregation attributes on a FieldRef but I've not been able to get anything to work. I'm not even sure that's the right place to be looking. I'm needing to accomplish this without writing a custom web part. 


Webpart - Get list item audit track in webpart



can any one tell how to get list item audit track in webpart like (how many time list item view by users i want total view count) ??


problem...i want a list item to populate all data in gridview!!!


i have a dropdownbox and a gridview

what I want is to have a list item which populates all data in a gridview.

I have tried using list item selected value=0 but to no avail.

what is the easiest way to achieve this?

show sub item to user



         I have a form where I took 2 dropdownlists. In 1st ddl I displayed all Religions and in 2nd DDL I displayed related castes. When my user filled the form so everything saved it. But when user logged in I unable to show him his choosen caste. Religion I displayed throgh RellgionId. But I don't understand how to do that?


      Can anyone tell me where I am doing mistake?



Attach Workflow to Task List, don't get option to manually start workflow via dropdown on task item



I am running WSS 3.0 with other workflows which are functioning correctly.  I created a new workflow in Visual Studio 2008 and was able to successfully run it in my dev environment.  I attached the workflow to a task list in my dev environment and was able to manually start the workflow by using the drop down workflow option and using the menus to manually start it.  I installed this workflow in our production environment and attached it to the task list (which had a SPD workflow attached to it which stopped working about a month ago).  I made sure that the option to manually start the workflow was checked.  When I tried to manually start the workflow, (hover mouse over title, drop down) there isn’t a workflow option.  The workflow also will not start automatically when a task is changed.


I attached this same workflow to a different task list in production and get the option to start it.


I have tried creating a small workflow in SPD 2007 and attaching it to the task list.  It shows that it is attached, when I look at the workflows that are attached to the task list, but I still don’t get the option to manually start it.


I have checked my security and I have fu

Workflow Task And Relevant List Item


Hello there...

1. What is the name of  the field thats connect between the task item and  the list name or guid and the list item id or guid

2. SPD: how can when starting the workflow how can i ensure that the initial form variables will be saved at the workflow task list

Many Thanks



Assigning users when creating a list item in a workflow


I'm using a workflow to assign tasks to users.  When I try to assign the task to a group (set in the workflow designer), the workflow gives me an error.  When I change the assign to property to a single user, the workflow works perfectly.  How do I get the workflow to assign the task to the group?  Or if that's not possible, can I get it to assign it to more than one user?


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