Friday 29 February 2008

GridView Select Rows Code 2.0

Simple link to a good post about how to make a Grid View row selectable without having a button at the end of each row, you can just click on the row to fire the onSelectedIndexChanging Event.

http://www.geekzilla.co.uk/

Linked Post written by : Paul Marshall

Here is a minor imporvement I made to the code written by Paul Marshall that just makes it easier to control the styling applied onMouseOver of the grid. I used it to change it so the whol row is highlighted rather than just underlining the text.

In GridView_RowDataBound I changed this bit of code to reference the my css file.

e.Row.Attributes["onmouseover"] ="this.style.cursor='hand';this.className='gridRollOver';";
e.Row.Attributes["onmouseout"] = "this.className='';";



A Belated Welcome to My New Blog

I created this new blog the other day when I realised I was starting to add lots of boring geeky programming stuff to my personal blog. The main problem with that is that my Wordpress blog isn't very customizable, the code quotes are crap and for some reason at the moment the edit tools are a bit broken.

So I decided to create a new blog just for all the boring coding tips and helpful hints I want to write about, mostly just as a place for me to collate stuff so I don't have to remember it in my head.

I was going to try a few different blog sites but Blogger appears to be really good and I quite like how customizable it is with so many templates and being able to edit the HTML directly for the template and CSS is much nicer than Wordpress so I'm just going to use this.

A link to my regular blog is in the side bar so I will still keep that going to write blog posts about general more interesting stuff than computer programming and save this bog just for the boring stuff.

MPH.

Wednesday 27 February 2008

Find Good Free Blog Templates

I just created this blog today and have been playing around with the formatting of it. I want to get a clear, easy to read and well organized template. Below is a link to the best template site you will find with hundreds of Free Templates for many different blogs.

http://www.eblogtemplates.com/

Also some nice CSS code to add a shaded boxes around areas for code or quotes:


blockquote
{
margin:.75em 0;
border:1px solid #596;
border-width:1px 1px;
padding:5px 15px;
display: block;
background-color: #dedede;
}

code
{
font-family: Courier;
margin:.75em 0;
border:1px solid #596;
border-width:1px 1px;
padding:5px 15px;
display: block;
background-color: #dedede;
white-space: pre;
}

SharePoint stsadm.exe and Powershell

Trying to run the SharePoint tool stsadm.exe in PowerSehll I get the following error:

The term 'stsadm.exe' is not recognized as a cmdlet, function, operable program, or script file


To get stsadm.exe to work in PowerShell you have to edit the 'profile.ps1' file.
Look in C:\WINDOWS\system32\windowspowershell\v1.0\ and if it doesn't exist just create a new file and add the following code:

Set-Alias -Name stsadm -Value $env:CommonProgramFiles”\Microsoft Shared\Web Server Extensions\12\BIN\STSADM.EXE”

Now you can use stsadm in Powershell without it buggering up.