Professional Web Applications Themes

Data Grid layout - ASP.NET Data Grid Control

I am trying to copy this asp layout in asp.net... [url]www.podge.net/AdvertList.asp?CategoryID=1[/url] in asp, i looped through the recordset and created a new table for each new DatePosted date. in asp.net i am hoping to use a data grid, but i'm not sure how to create a separate block for each DatePosted date. will i need a separate data grid for each DatePosted, or can I format one data grid to look like me old asp layout? thanks, Craig *** Sent via Developersdex [url]http://www.developersdex.com[/url] *** Don't just participate in USENET...get rewarded for it!...

  1. #1

    Default Data Grid layout

    I am trying to copy this asp layout in asp.net...

    [url]www.podge.net/AdvertList.asp?CategoryID=1[/url]

    in asp, i looped through the recordset and created a new table for each
    new DatePosted date. in asp.net i am hoping to use a data grid, but i'm
    not sure how to create a separate block for each DatePosted date. will i
    need a separate data grid for each DatePosted, or can I format one data
    grid to look like me old asp layout?

    thanks, Craig


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Craig Hudson-Bennett Guest

  2. #2

    Default Re: Data Grid layout

    One way to solve this would be to create a dataset with fields PostDate,
    Description, Location sorted by date.

    After you fill the dataset walk through it with a for each and add a header
    row every time the date changes. Here is some pseudocode to help you get
    started. (I'm in a hurry so the syntax will be a little sloppy, hopefully
    you'll get the idea and adjusting the code shouldn't be too bad)

    Dim x, y As Integer

    Dim myRow As DataRow

    Dim intDateCount As Integer = -1 'Would be -2 if you wanted a header and a
    footer after each section

    Dim strLastDate As Date

    Dim myNewRow As DataRow



    'Find out how many unique dates there are in the set


    For Each myRow In DsRooms.Tables(0).Rows


    If strLastDate <> myRow.Item("PostDate") Then

    intDateCount += 1

    strLastDate = myRow.Item("PostDate")

    End If

    Next



    'Set the upper bound of our loop to the number of rows plus the number of
    headings we will add

    y = DsRooms.Tables(0).Rows.Count + intDateCount



    If DsRooms.Tables(0).Rows.Count > 0 Then

    For x = 0 To y

    myRow = DsRooms.Tables(0).Rows(x)

    If strLastDate <> myRow.Item("PostDate") Then

    'new date, insert a header

    myNewRow = DsRooms.Tables(0).NewRow

    myNewRow.Item("PostDate") = strLastDate

    myNewRow.Item("Description") = strLastDate

    myNewRow.Item("Location") = ""

    DsRooms.Tables(0).Rows.InsertAt(myNewRow, x)

    'set next date

    strLastDate = myRow.Item("PostDate")

    End If

    Next


    End If


    "Craig Hudson-Bennett" <craighbbigfoot.com> wrote in message
    news:%23JLrFFKcDHA.1128tk2msftngp13.phx.gbl...
    > I am trying to copy this asp layout in asp.net...
    >
    > [url]www.podge.net/AdvertList.asp?CategoryID=1[/url]
    >
    > in asp, i looped through the recordset and created a new table for each
    > new DatePosted date. in asp.net i am hoping to use a data grid, but i'm
    > not sure how to create a separate block for each DatePosted date. will i
    > need a separate data grid for each DatePosted, or can I format one data
    > grid to look like me old asp layout?
    >
    > thanks, Craig
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    E. Wise Guest

Similar Threads

  1. Replies: 3
    Last Post: June 6th, 10:56 AM
  2. Grid Layout
    By Mepani in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: February 15th, 04:47 PM
  3. How to display a set of data in a data grid when drivenby a combo box?
    By Si Fi in forum Macromedia Flash Data Integration
    Replies: 5
    Last Post: August 16th, 05:03 PM
  4. Drag and drop data between cells in a data grid
    By Saravana [MVP] in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: June 7th, 03:55 AM
  5. Replies: 1
    Last Post: July 23rd, 05:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139