Warning: Creating default object from empty value in /homepages/42/d301471907/htdocs/wp-includes/functions.php on line 334
C l e a r G l a s s ~ Blog
CG Rotating Images

Welcome to C l e a r G l a s s

Subversion Links


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/42/d301471907/htdocs/wp-includes/functions-formatting.php on line 76

Subversion Addin for Visual Studio .NET
Ankh FAQ
Subversion Book
SVNServe -r hangs in Windows command. Use this instead:
Run SVNServe as a Service on Windows (svn://)

— admin @ 1:15 am 3/23/2006

Website Deployment


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/42/d301471907/htdocs/wp-includes/functions-formatting.php on line 76

Source Code management and database deployment
VSS Tips & Tricks
Moving and copying files via File System Object

— admin @ 9:52 am 3/18/2006

Datagrid Grouping - Subheadings


Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /homepages/42/d301471907/htdocs/wp-includes/functions-formatting.php on line 76

VBScript Code:


‘Before DataBind - Add New Rows Here for Each Sub Heading
Dim curCat As String
Dim prevCat As String
Dim row As TableRow
Dim i As Integer = 0
 
Do While i < = ds.Tables(0).Rows.Count - 1
curCat = ds.Tables(0).Rows(i).Item("CategoryName")
If curCat <> prevCat Then
prevCat = curCat
Dim shRow As DataRow = ds.Tables(0).NewRow
shRow("ProductName") = ds.Tables(0).Rows(i).Item(0)
shRow("UnitPrice") = “SubHead”
ds.Tables(0).Rows.InsertAt(shRow, i)
 
i += 1
End If
 
i += 1
Loop
‘End Insert SubHeadings
 
DataGrid1.DataSource = ds
DataGrid1.DataBind()
 
End Sub
 
Private Sub DataGrid1_ItemDataBound(sender As Object, e As DataGridItemEventArgs)
Select Case e.Item.ItemType
Case ListItemType.AlternatingItem, ListItemType.Item
If e.Item.Cells(1).Text.Equals("SubHead") Then
‘Format the data, and then align the text of each cell to the left.
e.Item.Cells(0).Attributes.Add("align", “Left")
e.Item.Cells(0).ColumnSpan = 3
e.Item.Cells(0).Font.Bold = True
e.Item.Cells.RemoveAt(2)
e.Item.Cells.RemoveAt(1)
e.Item.BackColor = Color.FromArgb(204,204,255)
End If
End Select
End Sub

References:

Including Subheadings in a Datagrid
Summarizing Data with ROLLUP, Part 2
Enhancing the DataGrid with Grouped Rows and Subheadings: ASPAlliance

— admin @ 6:49 pm 3/11/2006

ClearGlass LLC © 2009-2011. All rights reserved.