Existing Connection Example --- DataGrid Connection Examples -- Paging Example -- New Methods/Properties -- Error Properties

"Sort By" example using sort_clsDataGrid.asp

See ReadMe.txt for full description of new Methods/Properties.
Example #1 is a duplicate of Example #2 from ex_new_dbconn.asp except now I'm calling the .LinkColumn() method (see ReadMe.txt for desc). I've shortened some of the styles (end with "...") below so they don't wrap to a new line.

Code Used for following DataGrid:
---------------------------------
Set objDataGrid1 = New clsDataGrid
Call objDataGrid1.CreateConnection(strConn2)
objDataGrid1.Command = strQuery1
Call objDataGrid1.SetTableOptions(640, 2, 2, 0)
objDataGrid1.GridAlign = "center"
objDataGrid1.GridStyle = "color: #000000; border-style: solid; border-width: 1px; border-color: #666666;"
objDataGrid1.HeaderStyle = "font-family: tahoma, sans-serif; font-size: 12px; font-weight: bold;"...
objDataGrid1.ItemStyle = "font-family: tahoma, sans-serif; font-size: 12px; background-color: #FFEFAD;"...
Call objDataGrid1.BoundColumn("testCharacter", "Character Name")
Call objDataGrid1.BoundColumn("testFromWhat", "From What")
Call objDataGrid1.BoundColumn("testDate", "Date Added")
Call objDataGrid1.LinkColumn("testID", "http://www.google.com/search?q=#TEMP#", "Click Me", "_Blank")
objDataGrid1.Bind()
Set objDataGrid1 = Nothing

testIDCharacter NameFrom WhatDate Added
Click MeJerry SeinfeldSeinfeld08/10/2002
Click MeGeorge CostanzaSeinfeld08/10/2002
Click MeCosmo KramerSeinfeld08/10/2002
Click MeElaine BenesSeinfeld08/10/2002
Click MeKenny BanyaSeinfeld08/10/2002
Click MeUncle LeoSeinfeld08/10/2002
Click MeSoup NaziSeinfeld08/10/2002
Click MeJ. PetermanSeinfeld08/10/2002
Click MeNewmanSeinfeld08/10/2002


Example #2 is a duplicate of the example from ex_paging.asp except utilizes .LinkColumn() and .LinkClassName (.LinkStyle can also be used). "#TEMP#" will always be replaced with the current field value:

Code Used for following DataGrid:
---------------------------------
Set objDataGrid2 = New clsDataGrid
Call objDataGrid2.CreateConnection(strConn1)
objDataGrid2.Command = strQuery
objDataGrid2.PageResults = True
objDataGrid2.PageSize = 10
objDataGrid2.CurrentRecord = intBegRec
Call objDataGrid2.SetTableOptions("100%", 2, 2, 0)
objDataGrid2.GridClassName = "clsgrid"
objDataGrid2.HeaderClassName = "clsheader"
objDataGrid2.ItemClassName = "clsitem"
objDataGrid2.AltItemClassName = "clsitemalt"
objDataGrid2.FooterClassName = "clsfooter"
objDataGrid2.LinkClassName = "clslink2"
objDataGrid2.PagingLinkClass = "clslink"
Call objDataGrid2.BoundColumn("testID", "Character ID")
Call objDataGrid2.BoundColumn("testCharacter", "Character Name")
Call objDataGrid2.BoundColumn("testFromWhat", "Book/Show")
Call objDataGrid2.BoundColumn("testDate", "Date Entered")
Call objDataGrid2.LinkColumn("testID", "javascript:alert('Record ID is #TEMP#!');", "Click Me", "")
Call objDataGrid2.LinkColumn("testFromWhat", "http://www.google.com/search?q=#TEMP#", "#TEMP#", "_Blank")
objDataGrid2.Bind()
Set objDataGrid2 = Nothing

Character IDCharacter NameBook/ShowDate Entered
Click MeJohn GaltAtlas Shrugged08/10/2002
Click MeHank ReardonAtlas Shrugged08/10/2002
Click MeEddie WillersAtlas Shrugged08/10/2002
Click MeDagny TaggartAtlas Shrugged08/10/2002
Click MeRagnar DanneskjoldAtlas Shrugged08/10/2002
Click MeFrancisco D'AnconiaAtlas Shrugged08/10/2002
Click MeMidas MulliganAtlas Shrugged08/10/2002
Click MeJerry SeinfeldSeinfeld08/10/2002
Click MeGeorge CostanzaSeinfeld08/10/2002
Click MeCosmo KramerSeinfeld08/10/2002
    Next 10 »