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

Customizing

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 Create a custom site definition

Sitedef2

Ever wanted to create your own custom site definition? It’s pretty cool, if you can choose your own template at the time you create a site collection at the central administration. What can you by using a solution with a custom site definition?

Well, at first you can define fields, content types, lists, libraries and webparts which should be available after site is created. Of course, what was important for me, was the possibility to change the default.aspx page which is the starting point. At the default.aspx which is the entry point of each site collection you can place webparts, text, images, etc.

So  if you are creating your own site definition don’t leave it blank. Use an image and a welcome text. Maybe you can provide a small intoduction into this workspace and necessary contact information if the user needs help. Useful links might be also interesting. Your user should have a good feeling when starting with SharePoint. My desired solution should have a custom image and a welcome text.

Ok, that’s enough explanation. Let’s go into the details.

(more…)

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 create a wait message for long running tasks

In SharePoint 2010 and 2013 you have the nice looking Modal dialogs. I wrote already some posts about it. But now i would like to share how you can use these for long running tasks. For example if you perform a search which may take some seconds, it would be nice to give a small message for the user to wait. These are called the showWaitScreen like in the picture below.

waitScreens

How we can implement such a cool message window? Let’s start with the scenario. We have a custom application page. In this page we have a search button and a grid in which we will load data. The data loading operation takes a few seconds. So we start implement our script.

(more…)

SharePoint 2013 Access other fields from your custom fieldtype II

I already posted about this topic in this article. With SharePoint 2013 the solution from the old post didn’t work for me, so i had to find another approach. And for my hapiness, i found a solution which i would like to present to you. The idea is -again- to access the other fields in a display, edit or new form of a list. So if something occurs the values of the column X like title can be changed. The question is how to access these fields which are also in the form?

Look at the code below:



txtTitle = (TextField)GetFieldControlByName("Feldname");
txtTitle.ItemFieldValue = "Test";
txtTitle.UpdateFieldValueInItem();

//Function to interact with other fields
protected BaseFieldControl GetFieldControlByName(String fieldNameToSearch)
{
if (this.Fields.ContainsField(fieldNameToSearch))
{
return this.Fields[fieldNameToSearch].FieldRenderingControl;
}
else
return null;
}


At first i create a TextBox and call the function to get the textfield of the other column. So i call this.Fields.ContainsField(“Name”) in order to check if the field is available. If yes, i catch the FieldRenderingControl and return this one. After that i can cast it to Textfield.

To update or save the item just call your textbox with the function UpdateFieldValueInItem(). That’s it. Hope it helps you.

..:: I LIKE SHAREPOINT ::..