Thursday, April 25, 2013

Blogs


  http://zimmergren.net/

Sharepoint Metadata Display in treeview

http://zimmergren.net/technical/sp-2010-introduction-to-programmatically-working-with-taxonomies-in-sharepoint-server-2010

Open SharePoint 2010 modal dialog and refresh the parent page from custom form

Objective:
1) Open a SharePoint 2010 popup and refresh the parent page when one closes it.
2) Build a custom form that at “submit event” closes the popup and refreshes the parent page.
Solution:
-          Open a Popup using “Javascript” and “SP.UI.$create_DialogOptions();”
-          Add the method “CloseCallback” using the “dialogReturnValueCallback” property
-          Add some JavaScript code inside the CloseCallback to reload the parent page, like the following example:

<a href="javascript:openModalDialog('form.aspx');">Open My Custom Form</a>

<SharePoint:ScriptLink ID="ScriptLink1" Name="sp.js" runat="server" OnDemand="true" Localizable="false" />

<script type="text/ecmascript">

    var options;
    function openModalDialog() {
        options = SP.UI.$create_DialogOptions();
        options.width = 300;
        options.height = 100;
        options.url = SP.Utilities.Utility.getLayoutsPageUrl('customdialog.htm' );
        options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
        SP.UI.ModalDialog.showModalDialog(options);

    }

    function CloseCallback(result, target) {
        location.reload(true);
    }

</script>

Now when you close the popup, the parent page is refreshed.
If one is working with a Custom Form and wants to close the popup and refresh the parent after the Submit,
he could have two (or more) choices:
1) If you have 1 post back only, after the submit, the you can add in the page load the following:
protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack)
            {
                string script = "<script language='javascript'>parent.CloseCallback();</script>";
                if (!this.Page.ClientScript.IsClientScriptBlockRegistered("rKey"))
                    this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "rKey", script);
            }
        }

          2) If your custom form handles more than 1 post back, you can add the following code at one specific submit click event:
Context.Response.Write("<script type='text/javascript'>window.frameElement.commitPopup();</script>");
Context.Response.Flush();
Context.Response.End();

Monday, April 22, 2013

Links on Programming


GetAllViewUsing Webservice
---------------------------
http://sharepoint.stackexchange.com/questions/6985/how-do-i-get-all-list-views-by-using-a-web-service

using script::
------------
http://www.c-sharpcorner.com/UploadFile/anavijai/get-all-the-views-for-a-particular-list-in-sharepoint-2010-u/

Programmatically set XsltListViewWebPart to use Summary view in SharePoint 2010
----------------------
http://jasonssharepointblog.blogspot.in/2012/09/programmatically-set.html

http://sharepointnadeem.blogspot.in/2012/08/programatically-add-xsltlist-view.html


SPView on ToolProperties:
---------------------------

http://www.sharepointkings.com/2008/08/create-custom-listviewwebpart.html


SPGridView
------------

http://kalaimossblog.blogspot.in/2011/10/binding-spgridview-spview-items.html

http://sharepoint.coultress.com/2008/06/build-spgridview-columns-dynamically.html

SP Default Behaviour
-------------------
http://karinebosch.wordpress.com/sharepoint-controls/the-listviewbyquery-control/