Microsoft Vista …

I purchased a new HP Laptop with Microsoft Vista Business. It’s a 2 g dual core, Santa Rosa chip set with all the options offered by HP. The hardware is excellent. However, the operating system leaves much to be desired. It looks pretty and has allot of new features. But user friendly it is not.

Vista is suppose to be more secure but I have reservations. Maybe its because I can’t update Windows Defender. My laptop is setup to install updates automatically. It use to work but now only reports

"Error found: Code 0x80070643"

What a brilliant user message packed with NO user meaning.

A Google search yielded a potential fix. It entails turning off the auto update feature and rerunning the Windows Defender update. It didn’t work. Microsoft suggests its an issue with Office and asks that you set its service to Manual. It didn’t work. I then found a post where someone reinstalled Vista in a new partition, then copied the Windows Defender folder to the old partition and it fixed his problem. Now thats extreme and something I will not do.

Bottom line; I plan on ignoring the problem. Wonder how many others will do the same? What is the impact on security?

World of Warcraft…

It’s been some time since I last blogged and I blame it all on World of Warcraft. I finally gave the game a try. My character is Eok and it is a dwarf warrior. So far I have progressed to level 22.  I have only been playing for the last three weeks, so am very much a newbie. Tonight I teamed up with another player and took on an Ork encampment. We did quite well. The other play was a level 21 and made 22 as we played. I also introduced my grandson Jayson to the game as well as Sandy my wife. Both have characters at level 5 and really like the game.

I did find the time to add an HP Pavilion dv6000 to my computer collection. It’s a Vista machine. We will be rolling out MS Office 2007 later this year and Vista early next year at work, so I need to get up to speed new system. I am a Mac user, but so far I have to say I like Vista.  I did discover that Vista Home Premium will not run Virtual PC and had to upgrade to Ultimate. The upgrade was simple, but took well over an hour to complete. I actually let it run while I went to bed for the evening. My plan is to give the system a couple of months before I decide if it’s a keeper.

Set width of GridView edit field textbox…

How can the width of an edit text box be set in a GridView control where EnableSortingAndPagingCallback is true? Microsoft’s documentation for GridView.EnableSortingandPagingCallbacks states "If the Columns collection contains a column that does not support callbacks, such as TemplateField, a NotSupportedException exception is raised." So this rules out the use of a template column. I tried the template column and found it caused an error as advertised. I posted this question on Express Exchange but received only one bogus response.

Here is my GridView code…

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="100%"
            AllowSorting="True" AllowPaging="true" PageSize="12"   
            PagerSettings-Mode="Numeric"
            OnRowDataBound="BlackberryView_OnRowDataBound"
            EnableSortingAndPagingCallbacks="True" EmptyDataText="No records found!"
            DataSourceID="SqlDataSource1" AutoGenerateEditButton="True"
            OnRowUpdating="BlackberryView_OnRowUpdating"  EditRowStyle-Width="100%">
            <HeaderStyle CssClass="blackberryviewheader" ForeColor="White" Wrap="False" />
            <RowStyle CssClass="blackberryviewrow" ForeColor="#003366"  />
            <AlternatingRowStyle CssClass="blackberryviewalternatinfrow" />
            <EditRowStyle BackColor="Red" Width="100%" />
            <PagerStyle ForeColor="#003366" Font-Bold="true" HorizontalAlign="Center" />
        </asp:GridView>

After much searching of the internet, and only one bogus response from "Experts Exchange" I set to work my to solve the problem myself. Here is my work around…

  • Create a integer variable, editRow, and set its value to -2
  • When the OnEditRowEditing event fires, set editRow to the value of the selected row index.
  • As the ViewGrid re-builds, check for the row selected for editing. When found, check the specific cell for an empty string. If the cell contains a text box control the cell Text value will be "".
  • Next cast the cell’s first control to a TextBox then you can set its various properties including it’s width.

Int32 editRow = -2;

protected void GridView1_OnRowDataBound(Object sender, GridViewRowEventArgs e)
{
        TextBox tb = null;
        if (e.Row.RowIndex == editRow)
        {
            sVal = e.Row.Cells[2].Text;
            if (e.Row.Cells[2].Text == "")
            {
                tb = (TextBox)e.Row.Cells[2].Controls[0];
                tb.Wrap = true;
                tb.Width = Unit.Pixel(740);
                tb.Rows = 4;
                tb.TextMode = TextBoxMode.MultiLine;
                tb.Height = Unit.Pixel(60);
            }
       }
}

protected void GridView1_OnRowEditing(object sender, GridViewEditEventArgs e)
{
    editRow = e.NewEditIndex;
}

Two 20’s…

Img_0225jpg_2I have been toying with the idea of purchasing a 30" display for my Mac Pro. I even went so far as to do some bidding on eBay. I then got the bright idea to purchase a second 20" display. I was after all, primarily interested in increasing my viewing real-estate. As a developer you just can’t have to much screen. So I purchased a second 20" Apple display on eBay. The price was definitely right. My rational is, I can always sell both and get a 30" display. The second monitor arrived today and it is in perfect condition. The packaging was like original. The seller will definitely get a very positive comment from me.

The two monitors look great, and the added real-estate is very nice. My first impression is this is a great decision. However, I need a few days for the newness to ware off. Perhaps after one or two development projects I’ll know if two 20" are better then one 30".  Wonder how two 30" displays… that would definitely be over the top.

More Google Tools…

Looks like Writely, but now its Google Docs. It’s been some time since I checked my Google mail box and poked around their site. To my surprise I found Google Docs & Spreadsheets. Looks like I can delete Microsoft office from my Laptop. Well perhaps not. Without an internet connection I would be out of luck for a word processor or spreadsheet. But then again… not having to purchase upgrades is appealing.

This entry was posted via Google Docs… how cool is that.

Reading list …

Understandingajax_1

I just completed reading two book. Only one was on my reading list of October 21, 2006. From my list, I completed  "Understanding AJAX: Using JavaScript to Create Rich Internet Applications" by Joshua Eichorn. Overall I thought this was a really good book. I only wish that it was not so PHP orientated. Now don’t get me wrong, I like and use PHP. However, my principle focus in reading this book was AJAX.

Adprogramming

The second book was "The .NET Developer’s Guide to Directory Services Programming" by Joe Kaplan, Ryan Dunn. Now this was a tough read. Many a day I wanted to just chuck the book and move on to a more interesting topic. But I resisted temptation and made an end of it. It’s really a great book and most definetly a definitive text on the subject. Persevering through was a great learning experience. However, I must admit I now  seriously question the sanity of Microsoft developers who created the Directory Services monstrosity. On my to-do list is the read ing of at least one more book on the subject.

Headfirstobjectoriented

I am currently reading "Head First Object-Oriented Analysis & Design" by Brett D. McLaughlin, Gary Pollice, and David West. It’s not on my reading list. However, after the Services Programming book I need something light and quirky. The Head First series from O’Reilly definitely qualifies as quirky. Of course I mean that in only the most flattering terms.

ASP.NET Coding the OnClick Event …

Instead of placing controls on an .aspx page, I tend to create them in a C# class. For me, this architecture not only facilitates code reuse, but makes complex web applications easy to manage. One aspect of this architecture that is always problematic is event handling. My latest project was no exception. Its really a memory issue. That is my memory. Like I can’t remember from project to project the correct C# syntax.

The answer is really simple. Lets say you have a control with an ID of "ConcelNewRecord". When clicked, you want to cancel a pending action. Just code the control "Click" property as follows;

CancelNewRecord.Click +=  new EventHandler(this.CancelNewRecord_Click);

You will also need to code the event actions, e.g.;

protected void CancelNewRecord_Click(object sender, EventArgs e)
    {
        LinkButton lb = (LinkButton)sender;
        Panel Panel1 = (Panel)    lb.Parent.Parent.Parent.Parent;
        Panel1.Visible = false;
        lb = (LinkButton)Panel1.FindControl("NewRecord");
        if(lb != null)
            lb.Visible = true;
    }

The above code is encapsulated in a class that is instantiated from an aspx.cs page.