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

SharePoint Listen

SharePoint Reconnecting declarative created lookup fields

Often if you provision lists or libraries, your customer wants you to add a lookup column to another list, which may be in the same web. So you are starting with list definitions and do everything in the right way, but if you deploy your solution and create list instances from the source list and the list with the lookup, your lookup column is not connected to the source list. I don’t know why this happens, and i don’t care about the technical details why and why not. I’d rather share how to reconnect your defined lookup column to the source list.

Well, that’s what we want avoid:

Zwischenablage04

What do we need? We need c# code, we put this into a feature event receiver or anything what will be used for it. (more…)

SharePoint Create a tabbed view in c#

There are a lot of samples how to create tabbed view for list forms or webparts in SharePoint. Mostly they are build up with javascript, ajax or jquery. Well these technologies are really interesting, but today i am gonna make a short example of creating such tabbed views in c# using asp.net.

The advantages are crystal clear: If you have a form with lots of fields you can group them into tabs and the user

  • see the section important fields
  • does not need to scroll really deep
  • have all fields in the scope of his or her eyes

Ok, let’s start with a simple application page which we add to our project solution. I recently builded the demo based on this post.

In this application page we insert in the aspx file the following code into the placeholder main: (more…)

SharePoint 2010 Change font-size only for printing

Well, you might get the requirement from your customer that the printed list data is very small. So try it yourself. Print your listview and you will see that you need glasses to see the contents. The size for the webpage is ok, but the printview not. So what can you do?

It’s pretty easy. I used css in order to make the font-size bigger at a print view which doesn’t affect the normal browser font-size.

Simply add the following script to your masterpage:



@media print
{
BODY
{
font-size: 12pt; line-height: 24px; !important;
}
TD
{
font-size:12pt; line-height: 24px;  !important;
}
.ms-vb2, .ms-vh2
{
font-size: 14pt; !important;
}
TH.ms-vb, TH.ms-vh2
{
font-size: 14pt; !important;
}

}


Maybe you have to find out, which css classes you need to overwrite. But this css style will only be applied if someone is printing the list.

Hope this hels you.

..:: I LIKE SHAREPOINT ::..

SharePoint Using column validation to validate an E-Mail Adress

The Column validation of SharePoint is really great in 2010 as well as 2013. So i was looking for a possiblity to validate a textbox wether the user entered a valid email adress or not. After trying and figuring out what might be a good solution i came to the really great post of Chris Kent. He did a really great job – thank you Chris!

He posted the validation code below, which i tested and it works like a charm.



=AND(
ISERROR(FIND(" ", [Mail],1)),
IF(ISERROR(FIND("@", [Mail],2)),
FALSE,
AND(
ISERROR(FIND("@",[Mail], FIND("@", [Mail],2)+1)),
IF(ISERROR(FIND(".", [Mail], FIND("@", [Mail],2)+2)),
FALSE,
FIND(".", [Mail], FIND("@", [Mail],2)+2) < LEN([Mail])
)
)
)
)


You should look at his post, he explains also what exactly happens.

..:: I LIKE SHAREPOINT ::..

SharePoint 2010 Create a custom Picker with Dialog

If you don’t know what a picker is, you have two options. Option one is to cancel reading this post and go to google or option two you read on and look at the picture below:

Picker01

A picker allows users to open a separate dialog, in which they can search for items or elements which they want to choose. It only allows to enter values that are from these search results. A good example is the people picker. But if you want to use your own picker with your own values in it, you can do it by using code. So in this post i would like to share how i created my custom picker with a dialog.

For what can we use such custom picker? Examples:

  • To provide a special lookup list for customers, projects, resources, or other elements
  • Connect to a separate system (LOB) and get data from other sources than SharePoint
  • to make it easier to enter a special value of a large list or find an item in a large list

I used a separate list which i defined in the UI of SharePoint and called it “Customer” with a title column and a “ContactName” column, both from type Text. This list contains the possible values for the picker.

How should we start? (more…)