Wednesday, May 29, 2013

Removing Checkboxes from a SharePoint List View

Once in a while we get a customer who wants us to remove the checkboxes that display at the top on a list view web part.



This can be accomplished within SharePoint 2010 itself and by modifying the applicable list view.

Modify the list and locate the Tabular View section near the bottom. Expand this section and clear the Allow individual item checkboxes option.

Note: After modifying the view, you may need to reapply the view at the web part level on the page where it displays. Sometimes this type of changes are not immediately reflected on the pages, if never. So you have to force the change to go through, in which case you need to edit the page, edit the web part, and select the view at the Select View drop-down list within the List View section of the web part editing tool pane.

Tuesday, May 28, 2013

Sharepoint list Parent and child data filter using querry string ID


Add your list webpart on your page then using designer edit the page.

In side of "xsltListviewwebpart, on you page add below lines....

Add below line in <ParameterBindings>

<ParameterBinding Name="Param1" Location="QueryString(ID)" DefaultValue="" />

After that add below line in "<Query>"
<Where>
      <Eq>
       <FieldRef Name="tream_x003a_ID"/>
       <Value Type="Text">{Param1}</Value>
      </Eq>
     </Where>

Look on this below image


Monday, May 27, 2013

Sharepoint Control Hide in Dispform and EditItemform Using Script

Add the below lines where you want like Dispform or EditItemfrom.

Below this PlaceHolderMain

<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">

**********Start***********
<script type="text/javascript">

_spBodyOnLoadFunctionNames.push("hideFields");

function findacontrol(FieldName) {

   var arr = document.getElementsByTagName("!");
   // get all comments
   for (var i=0;i < arr.length; i++ )
   {
      // now match the field name
      if (arr[i].innerHTML.indexOf(FieldName) > 0)
      { return arr[i]; }
   }
}

function hideFields() {

   var control = findacontrol("Now");
   control.parentNode.parentNode.style.display="none";  
   control = findacontrol("MilestoneId");
   control.parentNode.parentNode.style.display="none";  
}
</script>
**********End***********