SharePoint 2013 Overlay Events to be Opened on Popup


 Yesterday we got a customer request that asked us to make all events on SharePoint calendar list to be opened on popup instead of open it on a new page

 We simply go to list setting and change dialog setting from list’s advanced settings. However this is doesn’t work for overlay events and continued to open it on a new tab Continue reading

Show SharePoint User Profile Image Without My-site Login


 Assume that you have a team site in the following URL and you have my-site web application at the following URL

 When you open your team site at without login to my-site, all users’ profile images will be shown as a cracked images until you logged into my-site web application or the windows authentication will be requested twice for the same reason. Continue reading

Use Signalr with SharePoint Webparts


Update 1: Download sample source code at!Ao7Q-78sQy60gcdrmHFyndmR_HWEMQ

Last month I got a task to make Signalr working on SharePoint environment. As all developers used to do on starting new tasks, I started my task with a search on Google to know how people made this task. I have found a lot of blogs speaks about that , however I didn’t get my answer as all people use SharePoint App-part in doing such scenario but no one made it on SharePoint web-part

It is totally different scenarios to use Signalr in app-part and web-part. App part simply is a separated ASP.NET and you can easily configure it away from SharePoint environment. To use Signalr in web-part or SharePoint user control you have to make extra configurations for Signalr and OWIN that are configured by default on ASP.NET web application. This made me deep dive into Signalr and OWIN architecture and make it work on SharePoint

Continue reading

Add New SharePoint Rich Content Editor Styles


All of us as a developers face a problem of misuse of the rich content editor that makes SharePoint site content looks very bad.

We always blame SharePoint power users (Content Editors) because we think that they must add a new content in a right way that make their content fits well with the whole site look and feel. On the other hand power users is not a web developer they don’t know about HTML and how to use it.

To eliminate this gab between developers and power users, it is good idea to provide them with a predefined custom styles to be used in editing content. To do this follow the following steps:

  1. Add a new CSS file or use any one referenced by that site
  2. Add new CSS class with the same conventions of the SharePoint Content Editor
  3. Save your file and open the SharePoint Content Editor to make sure your new style is their

Continue reading

SharePoint Logging Mechanism


 Logging useful information, Events and Exception is a core value for all software applications. Imagine that on a real world there are one organization used to log every information within a defined business process for reporting and another one leverage ad-hoc process which allow employees to deal with situations without any defined procedures for reporting to higher management. In the first style, management can monitor and improve its weaknesses by defining their weaknesses and failure points flagged by continuous monitoring  and back to the causes of these weaknesses. On the other side the second style, management never improve its weaknesses simply because they never know what are their weaknesses, when one weakness eventually is raised they couldn’t treat it although it might cost organization lot of money and loose customer trust.

 Software Applications are similar to organizations no one can know what happen inside it unless there is a rich dashboard to monitor its performance. In a software application system administrators are the top management of the product and the dashboard is the tools that help them to  monitor and define weaknesses and failure points.

 SharePoint has a very efficient technique to provide system administrator with the required information to monitor the system and provide developers with tracing information to use in solving issues. Developers also can use the SharePoint Logging System in their own customized  solution to provide system administrators a greet vision of monitoring and tracing. In this post we will speak on a brief about structure and how to use SharePoint logging System. Continue reading

Compare Content Types in SharePoint List


Did you try to get a content type attached to list by its Id? for example you need to add a condition if a list item is Folder content type

I tried, it was simple but tricky because it seems to have a new ID inherited from the original content type so you must get the item content type first then compare its Parent with the Content type you need.

Here is an example to know if the current item is Folder content type or not (Folder content type has Id = 0x0120) :

If you use the following code it will give false although the content type is folder type

item.ContentType.Id == new SPContentTypeId(“0x0120”)

you have to use the following code to make it work

item.ContentType.Id.Parent == new SPContentTypeId(“0x0120”)

Create People Search Page on Your SharePoint Web


SharePoint 2010 provide a people search as an out of box feature but you will not find a people search result page on your created site. You must create a new site collection based on Search Center template to find this page.

My problem was I need  people search results page on my current site to avoid redirect the user  to another site collection

The solution was so simple:

1 – Activate the ShrarePoint Server Enterprise Site Collection feature found on the site features

2 – Add People Search Core Results Web Part found in search category

3- Add a text box and button to redirect to this page with query string “k” which take the value of the your search ex(?k=Mohamed)

SPGridView Clear The Applied Fillter Programmatically SPGridView.ClearFilter()


I had a scenario like that:

I have a SPGridView with filter allowed, a DropDownList and a search button, the default behavior for the grid is to display all un-deleted users names and status which is ( Disabled or Enabled ). If I select view all users from the drop down and click search button the status is one of three (Deleted – Disabled Or Enabled) then I can filter the SPGridView to display all the deleted users.

The second step is to go the dropdown again and select un-deleted users only and click search button the result is empty grid view because the filter of SPGridView which is Status = ‘Deleted’ is sill applied.

The normal think is to go to search button handler and try to find a method like SPGridView.ClearFilter()
before you bind the grid again, but unfortunately I didn’t find a method like that.

After search on the internet I got a protected method that can do this but ‘it is protected’ the solution was like that the following steps:

1 – Create new class inherit the SPGridView class
2 – Add new method like the following to your class
public void ClearFilter()
3 – Register the new control to your page for example
<%@ Register Assembly=”$SharePoint.Project.AssemblyFullName$”  Namespace=”Project.NewClassNameSpace” TagPrefix=”CustomControl” %>
4 – Use the new control instead of the SPGridView
<CustomControl:NewClassName ID=”_pamsGridView” runat=”server” ……. %> …… </CustomControl:NewClassName%>
5 – Now you will find the ClearFilter method in the your Grid object