September 2003 - Posts

DHTML Reference

I'm having to do some funky DHTML stuff this morning, and I ran across this handy DHTML reference on MSDN that helped me out a bit.  What are your favorite DHTML resources?

Datagrid Mailbag: Changing row's cssclass on the client

Don't tell anyone, but I do sometimes answer Datagrid questions sent by private email.  (Note:  I don't have time to answer ALL the questions I receive, so I apologize if your question didn't receive a response).  So I thought I would share here some of the answers that I give.

Today's emailer wants to know:  How do I change the CssClass of a Datagrid row after the user has clicked on a HyperLink control in that row?

Well, I worked up a sample on how to do this using a Javascript function (and if anyone has a better way, please let me know).  Let's say the relevant Datagrid column looks like this:

    <asp:TemplateColumn>
    <ItemTemplate>
    <asp:Hyperlink id="docURL" runat="server" NavigateUrl=<%#"Javascript:ShowDoc(" & Container.ItemIndex & ");"%>>Doc Name</asp:Hyperlink>
    </ItemTemplate>
    </asp:TemplateColumn>

The Javascript I came up with (using the current row index in the grid):

   function ShowDoc(obj) {
    window.open('newpage.aspx', 'name')
tabs = document.getElementsByTagName("table");
tabs[0].rows[obj+1].className='ClickedClass';

    }

MSDN Article

Look quick, my new article for MSDN on Creating Custom Columns for the Datagrid is on the main page of MSDN!  Cool, thanks Kent!

This is my first article, so I'm now officially “published”.  Look for some more articles from me in the near future.

"What's Bad About Microsoft"

I ran across this link today (no, I wasn't looking for it).  From half-truths to the simply absurd, this link describes what the anti-MS crowd thinks:  “What's Bad About Microsoft”

Speaking in Tulsa

Hey y'all, I'm giving a Datagrid talk tomorrow night at the Tulsa .NET User Group.  If you're in the area, come on by...

Atlanta Job

A recruiter contacted me today about a senior .NET contract-to-hire position in Atlanta.  Requirements listed below:

* 6+ years of C++ experience in a Microsoft environment
* 3+ years of SQL Server experience 
* 3+ years web experience (ASP, ASP.NET, HTML) 
* Solid understanding of Object Oriented concepts 
* BS in Computer Science or related technical field.

If anyone's interested (and qualified!), drop me a line and I'll pass your information along.

Scrolling with a Datagrid in a DIV

Today I got the chance to make use of Jim Ross's excellent article, “Maintain Scroll Position in Any Page Element”.  It describes when using a scrollable Datagrid--one inside an overflow-auto DIV control--how to maintain the user's scroll position inside the DIV across postbacks, such as when a Select button is clicked.  It does this using IE behaviors, HTC files, which I hadn't used before, so that was fun, and it also solved my problem.

I also liked the ReadMe.txt that came with the sample downloaded code:  “The sample application is written in VB. If you only know how to read C#, stop whining and learn to read another language. It will be good for your soul, and your career.” :)

P.S. Jim also has a new article out about Datagrids and ViewState, check it out.

More Posts