Wednesday, April 13, 2005

Classic ASP Datagrid class


Classic ASP Datagrid class
Originally uploaded by Etienne L.
To complete my posting of the ASP.NET User Control datagrid, here is the older version...

This is a classic ASP datagrid implementing a hell of a lot of functionality and making sure everything is in a class and no images are required.

Basically only an include and some dead simple code can display data from a datasource on a webpage.

This example includes:

* Sorting
* Paging
* Styling (CSS)

I will post the code as soon as I have some space somewhere...

ASP.NET User Control Datagrid


ASP.NET User Control Datagrid
Originally uploaded by Etienne L.
This is an example of my latest ASP.NET user control datagrid. I will post the code for it very soon... only need to clean it up a bit.

This is NOT a server control (dll), it's simply an .ascx file. Dead easy. The features I have implemented are:

* Easy column sorting
* Paging (page numbers or triangles, no images required)
* Alternate coloring
* Custom ItemDataBound and ItemCommand events
* CSS Styles for the look and feel

It's not the most amazing one I have ever seen but it does the job extremely well and I use it all over my latest project!

Code will follow very soon...

Tuesday, April 05, 2005

Golden Shortcuts...

As a developer, you constantly have to use keyboard shortcuts to save time and to impress your colleagues ;)

There is the obvious ctrl+x, ctrl+c and ctrl+v that I use 1000 times a day, the ctrl+s (save), alt+tab, alt+shift+tab, ctrl+F4 (close inside window), alt+F4 (close window)... and so on.

Actually let me put a list of the ones I use constantly and tell me if you can think of others:
ctrl+x = cut
ctrl+c = copy
ctrl+v = paste
ctrl+z = undo
ctrl+y = redo
ctrl+b (with text highlighted) = make bold
ctrl+F4 = close inside window
alt+F4 = close window
alt+tab = switch to next app
alt+shift+tab = switch to previous app
shift+click (on URL in IE) = open URL in new window
ctrl+s = save
ctrl+shift+s = save all
F5 (in Query Analyzer) = execute (highlighted text or ALL if nothing highlighted)

But there is also the gold dust, shortcuts that take you years to work out and things you had no idea existed... and today I found one!!!

The first one that I did find about a year ago answers the question "How do you make a field NULL in SQL Server using the entreprise manager manual data edit within table?" the answer is to put the cursor in the relevant field (that you want to blank out) and press ctrl+0 (number "zero"). I have to say, I was pleased to finally get that one after years of "UPDATE tablename SET field = NULL WHERE ID = 11111"!

Today is one of those days where I am happy to add a new addition to my list of favourite shortcuts, the one I'm on about is probably one that VB developers like me will find extremely useful! It is ctrl+k and c or ctrl+k and u! What is it for are you going to ask... well have you ever tried to turn 50 lines of uncommented code to comments in VB?

It takes about 2 minutes to rem it, and 3 to rem it out cause you need to work out what lines are real code and what should remain comments.

ctrl+k and c will comment any highlighted text (multiple lines) in VS.NET!!! The other uncomments it... how brilliant is that!

For those who are anal like me about windows shortcuts, here is a VERY extensive list
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxurfvisualstudio70defaultshortcutkeys.asp

Hope this helps! Happy shortcutting!...