Link to edit item (ECB) on another column than Title – no code!

In SharePoint, any custom list will have a default column called “Title”. This column will have the edit menu attached to it when it is shown in a List View. The edit menu is also referred to as the “Edit Control Box” or ECB. The Title column can be renamed if another column name is preferred. This is easy and will be suitable for many situations.

What’s not so easy, though is to change the type of the Title column to something other than “Single line of text”, or to move the link to the edit menu to another column altogether.

For example: I would like a field called “Dropdown” to have the link to the edit menu, and the field “Dropdown” is a choice field with  - you guessed it – a dropdown list. At the same time, I don’t want to show the Title field at all. Not in my list view and not on my form. So, looking at the current state in the following screenshot: The link should be on the “Dropdown” column, not on the “Title” column.

Now, there are several ways of tackling this. I can turn on the content type management setting for the list, and then set the Title column to “Hidden” to remove it from the form.  I can edit the List View Web Part with SharePoint Designer. In a SharePoint 2010 XsltListView it is possible to designate any visible column to show the link to the edit menu by clicking a value in SharePoint Designer and selecting the chevron that pops out the options.

This seems like a lot of work though, and I’d also like the end user to be able to use the out of the box List view without any manipulation with SharePoint Designer.

Another approach involves using PowerShell. Can’t do that, though. I am an end user and have neither access nor permissions to run PowerShell scripts. I could put a request in our IT department’s long queue of things to do, but that will take time, involve a lengthy approval process, and I don’t want to wait for a week or more.

Yet another approach involves creating the list via Visual Studio and deploying it as a feature. Again, that is not a viable option for me. I’m not a developer, I don’t have access to these tools, and in general, I don’t want to litter my farm with features and solutions that are only used in one puny list.

So, I had to come up with a better way, and I think I found one.

Enter InfoPath.

I want to jazz up my form with InfoPath anyway, so while I was working on the list form in InfoPath, I did the following:

I set the default value for the “Title” field to the value of the “Dropdown” field.

Here’s the original form after clicking “Customize Form” in the List Tools:

Select the Title field and click the “Control Properties” in the Control Tools ribbon. Then click the formula button for the default value and insert the Dropdown field.

After that, delete the table row with the Title field. Now, whenever the Dropdown field is changed in the InfoPath form, its value will also be saved in the Title field.

An alternative method is to trigger an action when the “Dropdown” field is changed: Add a rule to the “Dropdown” field that changes the value of the “Title” field to be the same as the current value of the “Dropdown” field.

Publish the form and test it.

As an added twist, the Title column can be renamed to “Drop down” and the actual “Dropdown” column can be removed from the view. The result looks like this:

So there now: no custom code, no feature that needs to be deployed, no PowerShell, no SharePoint Designer. Instead, with  just a touch of InfoPath we have achieved the behaviour and look and feel of moving the “link to item with edit menu” to another column. At the same time, we’ve apparently changed the data type of the “Title” column to a choice column. Well, not really, but it sure looks this way. The user can create new views of the list and see that behaviour without involving SharePoint Designer or other tools.

Will that work for you?

cheers, teylyn

Share this:

Side by side trendlines in a column chart

The challenge: A column chart needs to show two sets of columns and have a trendline for each set of columns.

The screenshot below shows the desired outcome.

This post describes how to create this chart in 10 simple steps.

First, let’s arrange the underlying chart data:

 

Step 1

Create a column chart with two data series: simply select a cell anywhere in the table in columns A to C and click Insert > Column > 2D Column. Accept the defaults and delete the legend.

 

Step 2

Add the data for the blue series again, but this time select only the populated cells in column B, i.e.  =B2:B7

 

Step 3

Change the chart type of the new series to XY scatter.

 

Step 4

Edit the data source of the green series and use the values in column E for the X values, i.e.  =E2:E7

 

Step 5

Add the populated cells from column C as a new series with X values from column E, i.e.

X values =E8:E13
Y values =C8:C13

 

Step 6

Adjust the maximum value of the secondary X axis. The maximum value needs to be identical with the number of columns in the chart. In this example, the chart has 12 columns, so the maximum value for the secondary X axis needs to be set to 12.

 

Step 7

Format the columns to have 100% overlap and a smaller gap.

 

Step 8

Add a trendline to each of the XY series.

 

Step 9

Hide the XY series by formatting them to have no line and no marker.

 

Step 10

Hide the secondary X and Y axes by formatting them to have no tick marks and no axis labels.

 

Done. Download the sample file here: SideBySideTrendlines.xlsx

cheers, teylyn

Share this:

Why I like the CodeCage

There are many Q&A sites out there on the InterWeb where people can ask questions and get answers from volunteers who get a kick out of helping other people. During the last three years, I’ve tried out a few different Q&A sites and posted about 15,000 comments overall. Each site has its own philosophy, set of rules and set of features.  One site I prefer is TheCodeCage.com. The volunteer helpers include a very comprehensive list of Microsoft MVPs who really know their stuff.

The site runs on the vBulletin platform, but unlike many other vBulletin forums, TheCodeCage has a lot more bells and whistles.

One of the latest features TheCodeCage has added is the possibility to embed an Excel file via Office WebApps. If  the file is stored in the “public” folder of your SkyDrive account, you can embed an interactive version into a thread.

If you are asking a question, the volunteer helpers can see the workbook without having to download anything.

If you are answering a question, you can embed the working solution in your post and everybody can see it right there.

Here is a short video on how to embed your Excel workbook into a post at www.thecodecage.com:

cheers, teylyn

Share this:

A mega menu for SharePoint with a DVWP and a list

Mega Menus are a hot topic in current user interfaces. There are many JavaScript and jQuery tools out on the interweb that provide the JS code to present those Mega Menus in an appealing fashion. All these solutions use hard-wired html that hold the nested UL and LI items for the menu, though.

Within SharePoint, how can you create a SharePoint list to feed a Mega menu?

My latest article explains step by step how to create a SharePoint list that holds Mega Menu items and how to customise a DVWP to present the menu items in a format of nested lists. These lists will then be rendered by jQuery and JavaScript to create the completely configurable Mega Menu for SharePoint. Embed the DVWP in your master page and empower your staff to take control of the mega menu.

Read more …

cheers, teylyn

Share this:

How to use Excel on your iPad — no apps required

Did you know that you can use your iPad to view and edit Excel files? Well, I didn’t until a few days ago.

It’s really easy to do and the best thing is that it’s free. You don’t need any apps, you don’t need to install anything. All you need is your iPad, an internet connection and a free Windows Live ID and SkyDrive folder.

Read here how you can get your iPad up and running with Excel in next to no time.

cheers, teylyn

Share this:

View Excel workbooks side by side in Office Starter 2010

Some Windows 7 computers come pre-installed with Office 2010 Starter, an edition that features reduced functionality and advertisements. In Excel 2010 Starter, the only ribbons the user can see are File, Insert, Page Layout and Formulas. The View ribbon is not displayed, so much of the functionality of the View ribbon cannot be used.

Still, if you use Excel 2010 Starter you can still work with more than one Excel file at a time and you may want to see the workbooks on the screen all at once, side by side or top and bottom, instead of one at a time. In a full version of Excel, you’d click View > Arrange All, and then select from the options (tiled, horizontal, vertical, cascade).  But since there is no View ribbon in Excel 2010 Starter, you may feel stuck.

Not so.

You can still view your workbooks side by side or one on top of the other. It’s just a bit more work than in the full version.  Here’s how:

  1. Open Excel and load the first workbook.
  2. Click File > Open and open the second workbook
  3. hover the mouse over the Windows 7 task bar, so you see the thumbnails of the two workbooks.
  4. in the title area of one of the thumbnails, right-click and select “Restore”
  5. now the two workbooks will be individual windows within the main Excel window
  6. drag and resize the windows to fit side by side or any way you want to arrange them
  7. for more sophisticated options, upgrade your Office version ;)

cheers, teylyn

 

Share this:

Quick preview of SharePoint 2010 theme colors? PowerPoint!

In SharePoint 2010 it is easy to create custom color themes to jazz up a site, although trying out different color ideas may take a while, since it takes SharePoint some time to save, apply and render a new theme. Not good if you quickly want to flick through a few ideas.

Using Office 2010, theme colors can also be created in PowerPoint with a few clicks. But how do the chosen colors actually look in the SharePoint site? Where does which color go?

The PowerPoint template attached to this article has a preview of all the main elements of a SharePoint 2010 team site with the selected color theme — and it renders on mouse-over!

Read on …

cheers, teylyn

Share this:

Infopath 2010 validation woes

While working on an Infopath 2010 form to be used in one of the SharePoint 2010 sites, I came across two challenges. End users will enter a number in a field, where values between 0 and 100 are allowed, in increments of 0.5. For example 11 or 22.5 or 65.0 are OK, but not 0.3 or 17.9.

How to set up data validation in InfoPath to allow a numeric value with only a 0 or a 5 as a decimal? And how to get that data validation to actually work in the published form in SharePoint 2010? Here’s what I found:

1. How to allow a numeric value with only a 0 or a 5 as a decimal in InfoPath 2010?

Data validation is not a foreign concept. Custom data validation formulas should be easy enough for someone who does it every day in Excel, where I’d simply use a custom formula along the lines of

=OR(MOD(A1,1)=0,MOD(A1,1)=0.5)

But armed with that knowledge, looking through the functions available in InfoPath2010, I’m dismayed at finding that there is no MOD() function in InfoPath 2010. Hmm. There’s a couple of rounding and floor/ceiling functions, though, so I will have to do some thinking.

Back in Excel, I play around in the more familiar territory and arrive at this, which works a treat:

=FLOOR(A1/0.5,1)*0.5=A1

It’s even shorter than the MOD() formula. :) Translated into InfoPath syntax, this reads as follows: TheField must be equal to

Floor( TheField / 0.5 ) * 0.5

If the result of that formula is not equal to TheField, then the data validation fails, so the comparison operator for TheField must be set to “does not equal” (does anyone else find the InfoPath negative validation logic slightly irritating?) Entered in the InfoPath Function box, the formula checks out with no errors.

Great. Publish. Test.

Hmmphh. The form in SharePoint 2010 happily accepts values like 2.1 and 5.6. What the …?

2. How to get that data validation to actually work in the published form in SharePoint 2010

After much head scratching and searching on the InterWeb, I find a hint here: InfoPath 2010 validation rules must use a screentip.

Let that roll off your tongue: InfoPath 2010 validation rules MUST USE A SCREENTIP.

I find screentips mighty annoying and I happily left the screentip textbox blank for my data validation test, but exactly that was the problem. Apparently, InfoPath 2010 deletes some data validation rules if they don’t have a screentip. That means, as soon as the form is published, the data validation gets wiped. In InfoPath 2007 you can’t save a form unless all your screentips are in place, but InfoPath 2010 happily lets you save and publish, and then silently drops half of your work. Nice one, Microsoft.

So I grumbled a bit and entered some text in the screentip.

Publish. Test. Success!

Now I know how to do it, and so do you.

cheers, teylyn

Share this:

Beware of absolute links

This should be easy-peasy for anyone who has their html under control.

If you develop a site that will move through different environments (i.e Dev/Test/Prod domains), make sure that the links you use are relative to the site root and not absolute paths to the domain.

Example at hand: The SharePoint site image was set to

http://MyTestServer:1001/SuperDuperImages/Icons/SuperLogo.png

When the SharePoint site was migrated into another environment, with a proper host header and a URL like

http://OurNewSite

in another domain, the absolute link to the site image broke. Red X for the image. No surprise, really, but a lesson for developers.

However tempting it may be to just copy and paste an image URL into the site image field, please spend a moment and consider the implications.

Do NOT use an absolute reference to a particular site.

If you use an absolute path like this …

http://MyTestServer:1001/SuperDuperImages/Icons/SuperLogo.png

… it will bite you in the butt when you move the site to a different domain or change the host header or port for the site in your DNS or IIS settings.

Instead, take the easy way out and start at the site root when defining the site image (or any other site specific setting, for that matter). Use a relative path like

/SuperDuperImages/Icons/SuperLogo.png

Now, when you move the site to a different domain/server/environment, the link will still work.

This seems like a really, really basic issue, and it does not have much to do with SharePoint per se. But when you copy an image location from a SharePoint image library and stick it into the Site Image field in “Site Settings > Title, description and icon” , you will automatically end up with the absolute path. That’s what a copy and paste of the image URL will deliver.  Make sure to edit it the pasted URL and remove all pointers to an absolute address.

cheers, teylyn

Share this: