ASP 101 - Active Server Pages 101 - Web03
The Place ASP Developers Go!

Please visit our partners

Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology
International

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash




ASP.NET "Database Highlight" Sample


When I started trying to implement last week's database row highlighting sample in ASP.NET, I naturally looked for a simple and elegant solution. When I was unable to come up with one easily on my own, I went to the web. Surely someone had done this before. The answer was bound to be out there just waiting for me to find it. Well I found plenty of answers, but none of them were very simple, let alone elegant.

The best of what I found came from the place I usually end up finding the best stuff... 4GuysFromRolla. Both Creating a Row-Selectable DataGrid Control and An Easier Way to Highlight the Rows of a DataGrid on MouseOver address the issue at hand and actually do a pretty good job. The problem is that the first is relatively complicated (it creates a new custom control which inherits from the DataGrid to get the job done) and the second has some compatibility issues (which stem from the author's desire to use CSS even though the lack of support for it forces him to use JavaScript to back it up anyway). While the solutions presented in those articles are probably technically "better" then my approach (the reusability and added functionality of the custom control in particular are big benefits), I wanted something simple (I'd long since given up on any level of elegance).

So here it is... the secret to getting simple database row highlighting in ASP.NET -- don't use the DataGrid! Instead of trying to wrangle the JavaScript into the table that the DataGrid generates, I just used the Repeater instead and built my own table. It may not be the coolest or most exciting approach (and we already know it's not the most elegant), but it's pretty darn simple. Just take a look at the code...

Here's a zip file of the code (1 KB).

Play with the running version.

View the live source code.


Back to the "Database Highlight" sample


Samples

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM eBook: Planning a Service Oriented Architecture
IBM eBook: Choosing the Right Architecture--What It Means for You and Your Business
Microsoft Article: Will Hyper-V Make VMware This Decade's Netscape?
Avaya Article: Using Intelligent Presence to Create Smarter Business Applications
Intel Go Parallel Article: Getting Started with TBB on Windows
Microsoft Article: 7.0, Microsoft's Lucky Version?
Avaya Article: How to Feed Data into the Avaya Event Processor
IBM Article: Developing a Software Policy for Your Organization
Microsoft Article: Managing Virtual Machines with Microsoft System Center
Intel Go Parallel Article: Intel Threading Tools and OpenMP
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
HP Video: StorageWorks EVA4400 and Oracle
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Red Gate Download: SQL Toolbelt and free High-Performance SQL Code eBook
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
Silverlight 2 App and Walkthrough: Leverage Silverlight 2 with SQL Server and XML
IBM Article: Enterprise Search--Do You Know What's Out There?
HP Demo: StorageWorks EVA4400
Microsoft Article: The Progress and Promise of Deep Zoom
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES