July 1, 2013

Open SharePoint out of the box list Dialogs maximized

Application pages for SharePoint lists opens in dialogs by default. We can change it if we want to open in forms instead of dialogs by changing settings in advance settings. In list settings -> advance settings -> Launch forms in dialogs? -> select option "No" will open in Forms and "Yes" will open in Dialog.
If you want to open in maximized dialog, just add below JavaScript method in your page. And call this method in document.ready method.

   1:  function maximizeWindow() {
   2:  try {
   3:    var currentDialog = SP.UI.ModalDialog.get_childDialog();
   4:    if (currentDialog != null) {
   5:        if (!currentDialog.$S_0) {
   6:     currentDialog.$z();
   7:        }
   8:    }
   9:       } catch (e) { }
  10:   }
  11:   ExecuteOrDelayUntilScriptLoaded(maximizeWindow, 'sp.ui.dialog.js');

If you have any questions you can reach out our SharePoint Consulting team here.

The list cannot be displayed in Datasheet view for one ore more of the following reasons

Issue:
If you try to open a SharePoint 2010 list within the "Datasheet View" the following error appears:
The list cannot be displayed in Datasheet view for one ore more of the following reasons:
   - A datasheet component compatible with Microsoft SharePoint Foundation is not installed.
   - Your Web browser does not support ActiveX controls.
   - A component is not properly configured for 32-bit or 64-bit support.

Solution:
There is a Microsoft component necessary to be able to use the "Datasheet View":
   - 2007 Office System Driver Data Connectivity Components
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7554f536-8c28-4598-9b72-ef94e038c891
After installing this package, you should be able to use the "DataSheet View".

If you have any questions you can reach out our SharePoint Consulting team here.

June 13, 2013

Datasheet view error 0x80070057

Problem:
This error occurs when you try to ​edit People OR Group field in datasheet view.
Root cause:
Due to inappropriate declaration of site column \ column in list definition this error occurs
Solution:
   1:  $field = $newSite.RootWeb.Lists["ListName"].Fields.GetFieldByInternalName("FieldName")
   2:  $field.SchemaXml = $field.SchemaXml.Replace("<Field", "<Field List=""UserInfo"" ")
   3:  $field.Update()

If you have any questions you can reach out our SharePoint Consulting team here.