Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Please Help - Dynamically Creating Datagrids

Thread Tools

Please Help - Dynamically Creating Datagrids

Jamie Sutherland
Posts: n/a
Below is a piece of my code. What it does is displays datagrids on my
webpage. That part works ok it displays the data including the filtered. But
what it does is creates each table below one another. How do I get it to
either displayed next to each other (TABLE1 | TABLE2 | TABLE3) or Below one
another but with "<p></p>" tages in between each table .
Please help

Function CreateDataGrid(ByVal category As String)
' Create Row Filter for Categories
Dim dvCat As New DataView(ds.Tables("Links"))
dvCat.RowFilter = "Category='" & category & "'"

' Dynamically create the Datagrid
Dim dgLinks As New DataGrid
dgLinks.DataSource = dvCat
dgLinks.ItemStyle.BackColor = Color.AliceBlue
dgLinks.AlternatingItemStyle.BackColor = Color.Azure
dgLinks.Width = Unit.Pixel(200)
dgLinks.HeaderStyle.BackColor = Color.DarkBlue
dgLinks.HeaderStyle.ForeColor = Color.White
dgLinks.HeaderStyle.Font.Bold = True

' Set up the columns collection programatically, not Automatically
dgLinks.AutoGenerateColumns = False

' Add a hyperlink column
Dim hlc As New HyperLinkColumn
hlc.HeaderText = category
hlc.DataTextField = "Link_Title"

hlc.DataNavigateUrlField = "URL"

' Dynamically Add DataGrid into the Page
End Function

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Naming dynamically created datagrids Anna ASP .Net 1 04-15-2005 02:07 PM
Dynamically created Datagrids data lost on Postback ree32 ASP .Net 4 02-21-2005 05:17 AM
Dynamically created Datagrids data lost on Postback ree32 ASP .Net 1 02-18-2005 05:09 AM
DropDownLists in DataGrids-- can I dynamically name them? Jim Bancroft ASP .Net 3 12-20-2004 03:52 PM
Dynamically positioning DataGrids Shane O'Keeffe ASP .Net 4 08-04-2004 02:53 PM