Archive for April, 2008

Set gridview header color in css

Setting a gridview header forecolor is pretty straight forward. One thing to keep in mind is that enabling sorting makes the header element = A, so you need to have an A class in your css.


.dgrHeader
{
color:Red;
text-align:left;
height:10px;
}
 
.dgrHeader a:link, .dgrHeader a:visited, .dgrHeader a:active
{
color:rgb(102,102,102);
text-align:left;
height:10px;
}


After your css is configured, you can either set the property programatically:

 
grdTemp.HeaderStyle.CssClass = "dgrHeader"

or in the grid itself:


<HeaderStyle CssClass="dgrheader" />

Collection was modified; enumeration operation may not execute.

Certain collections blow out when you use a for each loop, as the change in value results in the item dropping out of the collection.

This code resulted in the above error as it caused the CheckNodes collection to change.


For Each node As TreeNode In TreeView1.CheckedNodes
    node.Checked = False
Next

Re-writing the code as so works fine:


Dim y As Integer = TreeView1.CheckedNodes.Count
While y > 0
    TreeView1.CheckedNodes.Item(0).Checked = False
    y -= 1
End While

Little Big Man

I usually shy away from western themed fiction, but Berger’s writing style got me involved right off. Doesn’t go overboard on the dialect and lets the story speak for itself.

Little Big Man

The Marine Corpse

Lawyer as super-sleuth can get annoying. This tiptoes up to the line. Too short to develop any real feeling.

The MARINE CORPSE

The Dutch Blue Error

Didn’t like this one much.

The Dutch Blue Error

Marine Sniper

A really good read. Pretty incredible story.

Marine Sniper: 93 Confirmed Kills

javascript debugging in VS 2008

If you want to step through your javascript code in VS 2008, be sure to add the js as a separate file, rather than inline. Unhandled js errors will still break to the error point, but breakpoints do not appear to function for inline js.

Convert RBG to hex

If you have ever tried to match a custom palette in Excel to hex codes, you know what a trial that can be.

Getting the Excel RBG is pretty simple: Tools / Options / Color / Modify / Custom.

Next, open up Microsoft Calculator under Accessories. Make sure the Dec radio button is checked, enter the R code and click the Hex radio button. Repeat for B and G and you have your hex code that now matches the Excel color exactly.

Detailed instructions

Hanged Man’s Song

I really like Sandford, but this book started to annoy me. Computer geek as super-hero with the power to change the world on a laptop gets a bit tedious.

The Hanged Man’s Song

The Devil’s Code

First of the Kidd novels I have read. Much different from the Davenport series in both the protagonist view and technical details.

The Devil’s Code

recreate designer.vb

After adding the AJAX control toolkit, the designer.vb page stopped staying in synch when I would add and delete controls.

Even though there were no compile errors and all the toolkit controls rendered fine in VS 2008, the designer file needed a reference to the AJAX toolkit in the project. I had only placed the reference in the actual page.

To regenerate designer.vb:

Delete the designer.vb page, right click on the aspx page and choose Convert to Web Application.

Knight’s Cross : A Life of Field Marshal Erwin Rommel

I found this book to be dull and plodding. Quite a surprise when considering the topic. Still, there were some interesting sections, including Rommel’s exploits in Italy during WWI.

Knight’s Cross : A Life of Field Marshal Erwin Rommel