..:: I like SharePoint ::.. Rotating Header Image

Best Practices

SharePoint 2010 document icons are not displayed correctly

You installed the PDF iFilter or modified the docicon.xml in any case in the /template/xml folder of the SharePoint Hive in order to see afterwords pdf icons or other icons like word, excel, etc. But the icons are not displayed correctly? None of them? Well maybe you just have to check the docicon.xml again

Sometimes there are errors like

  • the image name is not correct
  • or the double quote in the map attribute is not correct

Correct double quote = ”

Incorrect double quote = “

So then first check twice that your docicon.xml file is correct.

..:: I LIKE SHAREPOINT ::..

SharePoint 2010 Display all Sites i have access – fast and easy way

Search driven applications are applications which use the search service in order to provide data or do other stuff. They can be configured by using the availables search webparts or they can be developed by using visual studio and c# as well as XSL. So it depends what you prefer. There are many posts and instructions how to do it.

Today i would like to share an easy way to create a webpart which displays all sites to which i / the current user have access to. I use the search core result webpart and configure some things and got a nice result afterwards without programming anything.

(more…)

InfoPath setting date value with code behind

Format matters! So if you ever tried to set a date value to an infopath form by using code behind, you might got this really nice displaying with a beautiful red dotted border:

Why? It’s easy – cause you have to format the date in the right way InfoPath expects it! InfoPath expects it this way: yyyy-mm-dd.

Well that’s easy. But in order to overwrite the value of a datefield, you have to insert these lines of code in order to overwrite a date field with string values! So i didn’t test it without this function:



public void DeleteNil(XPathNavigator node)
{
if (node.MoveToAttribute("nil", "<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"))
node.DeleteSelf();
}


After that you can use this function in order to set attribute and overwrite the field by setting the value as you desire.



//In order to overwrite the field with datetime

//Opening the access to the field of the form
XPathNavigator navForm = this.CreateNavigator();
XmlNamespaceManager NS = this.NamespaceManager;

DeleteNil(navForm.SelectSingleNode("/my:meineFelder/my:CreationDay", NS));

DateTime getDate = Convert.ToDateTime(dr["CreateDate"]);

string convDate = getDate.ToString("yyyy-MM-dd");

navForm.SelectSingleNode("/my:meineFelder/my:CreationDay", NS).SetValue(convDate);


And it looks like a normal date field:

As you can see the red dotted validation does not show up.

..:: I like SharePoint ::..

SharePoint 2010 Change text of add new item

Creating a list is normally not that difficult. But if you use the list in order to manage travel requests, vacation requests or any requests, you might don’t like the text of the link “add new item” below the listview which comes with the standard.

If the user wants to make a new request of whatever, he expect that there is a link to add a new request of whatever and not add new item. You maybe like to have something like

  • request travel
  • request vacation
  • add new request XX
  • and new project request

Whatever you want to have there, it is possible just by using the SharePoint Designer. (more…)