Sunday, November 14, 2004

Data View Web Parts

Although in my last post I mentioned SharePoint from the project management perpective, here's a tip that's purely development.

One thing that winds me up is how SharePoint deals with ghosted pages. As soon as a page is unghosted it's lost to any future template changes. If you unsure to what unghosted pages are in SharePoint let me assure you they are "a bad thing".

Now should you wish to create a data view web part from an existing list, you have to do it in FrontPage, and you have to then hit the save button, unghosting it and casting the page down in to the 7th circle of SharePoint annoyances.

Unless...

You first create a new web part page, and place your list as a web part on that new page. Then in FrontPage convert it into a Data View web part and do all the customisations you wish. Once done, hit save.

Then visit the page in Internet Explorer. Modify the properties of the data view web part and you'll see the three buttons in the toolpane that displays the properties on the data view web part (Source Editor, DataQuery Editor, Parameters Editor). Open each property window and copy and paste the values to 3 local text files.

You can now delete the web part page and the data view web part it contains. (Although I'd recommend waiting until you know this whole process has worked)

Now go to the page you really want to display the data view web part on.

Drop an empty Data View web part in to a zone. Open the toolpane, and for each property button paste in the values from your local text files.

You'll now have your customised Data View web part, and no unghosting will have taken place!

High-five!

What’s that? You don't have an empty Data View web Part? Ah.

Right-click save target as on http://gilesgregg.com/Data%20View%20Web%20Part.dwp.

Copy it in to your wpcatalog folder under the sites’ root iis folder and you'll then find it under the Virtual Server gallery.

Alternativly you could export the web part to a .dwp file off the temporary web part page and then import it to the destination page. This is certainly an easier method in the short term, but I've found having an empty data view web part in the Virtual Server gallery quite useful.

Any feedback gratefully received...

Saturday, November 13, 2004

Back from holiday

Ok, so I wasn’t actually on holiday for 3 months, but on my return I started a new job project managing a SharePoint implementation rather than acting as a technical consultant.

A very different way of working.

While tech knowledge helps in that role, you obviously spend much less time dealing with code and .aspx templates and the like, which has left me with not so much to publish.

I have had quite a few circumstances where I’ve had knowledge that would be useful to post, but as a project manager, you’re not in the frame of mind where your instinct is to rush to your blog. Your responsibility is to resolving problems and keeping the project on track.

I’m going to try this method of posting to my blog via email, and perhaps posting SharePoint thoughts from the perspective of a project manager.