Welcome to DetlefGrohs.com Sign in | Join | Help

September 2007 - Posts

Adding Choice Site Column Code Snippet

This code snippet shows how to add a choice field as a site column in SharePoint 2007. spweb.Fields.Add("MySiteColumn", SPFieldType.Choice, false); SPFieldChoice field = (SPFieldChoice)spweb.Fields[fieldname]; field.Group = "MyGroup";
posted by detlef | 0 Comments
Filed Under: ,

Yet Another Halo 3 Post

I got Halo 3 when I got back into town and I am enjoying it immensely. I started on Easy, but restarted on Normal once I realized that you don't get any achievements until you play on Normal or better. I am on the 4th mission now and it has been great.
posted by detlef | 0 Comments

DateTime Site Column Code Snippet

Another code snippet that creates a Date/Time site column in SharePoint 2007. I need to collect all of these field creation code snippets into a longer more comprehensive post. spweb.Fields.Add("MyDateTimeField", SPFieldType.DateTime, false);
posted by detlef | 0 Comments
Filed Under: ,

Jagged Array Code Snippets

I use the following methods to send a Hashtable to and from a web service call. I specify that the signature and or parameter of the web method are object[][] and use the following methods to convert a Hashtable to and from an object[][]. /// <summary>
posted by detlef | 0 Comments
Filed Under:

MatchAndReplace Code Snippet

I use the following code snippet to do a regex search and replace in a string without having to worry about all of the syntax around the method calls to regex. This supports all of the regular expression matching syntax commands in both the pattern and
posted by detlef | 0 Comments
Filed Under:

[BlogMyCode] Code Snippet Posted with BlogMyCode Plug-In

[BlogMyCode] Code Snippet Posted with BlogMyCode Plug-In Update: Well that didn't work.
posted by detlef | 0 Comments

Code Beautifiers

I might be doing some JavaScript client side programming for my next project, so I saw this My Great Free Online Beautifier for JavaScript that I need to save a reference to. I then starting thinking that I have seen other online code beautifiers before
posted by detlef | 0 Comments
Filed Under:

Read Document Contents Code Snippet

The following code snippet will load the contents of a item in a document library in SharePoint 2007. I am loading the contents of the first item, but you could easily use Items.GetItemById() method to get a relevant item. SPList list = spweb.Lists["MyList"];
posted by detlef | 0 Comments
Filed Under: ,

Glad that I have an XBox360

There is much to be thankful for lately if you have an XBox360. I am still trying to complete BioShock on hard for the achievement and then I will have to go through one more time to get the last achievements that I am missing. I am also putting a lot
posted by detlef | 0 Comments
Filed Under:

WriteToLog Code Snippet

A quick method to write a message to the Event Log. I use this when I can't use the Logging Application Block or when I just need to a quick message in the event log when debugging an issue. public static void WriteToLog(string message, EventLogEntryType
posted by detlef | 0 Comments
Filed Under:

GetWebPage Code Snippet

I use the following method to get a web page as a string for processing. private static string GetWebPage(string requestURL) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestURL); request.UseDefaultCredentials
posted by detlef | 0 Comments
Filed Under:

Adding a Lookup Field to a SharePoint 2007 List Code Snippet

This code snippet will add a lookup field to a list in SharePoint 2007. Change the false in the AddLookup call to true if you want to make it a required field. I will be posting a long post on how to add or modify any field type through the API in SharePoint.
posted by detlef | 0 Comments
Filed Under:

How to Make a Field Read-Only in SharePoint 2007 Code Snippet

The following code snippet will make a field appear read-only in SharePoint 2007. The field will appear on lists and view forms, but will not show the field for editing on new or edit forms. SPList list = spweb.Lists["MyList"]; SPField
posted by detlef | 0 Comments
Filed Under:

SharePoint 2007 Web Part Property Attributes Code Snippet

Here is an example of the attributes need to make a property for a Web Part appear properly on the tool pane in SharePoint 2007. [WebPartStorage(Storage.Shared), WebBrowsable(true), Personalizable(true), SPWebCategoryName("MyCategory"), WebDisplayName("My
posted by detlef | 0 Comments
Filed Under:

My Blog is Dead

Based on Scott Hanselman's post A Blog's Heartbeat my blog's heartbeat has been 0 for a while. I recently made the decision to post more and update it often with what I am learning each day. Update: I should have modified the pulse graph above to be
posted by detlef | 0 Comments
Filed Under:

GetStringResource Code Snippet

I use the following method a lot to load an embedded resource from the current assembly as a string. I use variations on this for other types of resources such as images and XML documents. private string GetStringResource(string resourceName)
posted by detlef | 0 Comments
Filed Under:

Testing New Plug-Ins

Testing a couple of new plug-ins for Windows Live Writer: Insert Gamer Card   detlefgrohs And Insert a Spaces Emoticon
posted by detlef | 0 Comments

New Windows Live Writer Version

Just installed the latest Windows Live Writer Testing to make sure it posts to my blog still.
posted by detlef | 0 Comments

Test 09232007

Testing to make sure my blog and my connection to it still works.
posted by detlef | 0 Comments