Displaying vertical data

Discussion in 'ASP .Net Datagrid Control' started by Mike Harris, Jan 11, 2005.

  1. Mike Harris

    Mike Harris Guest

    I built a survey that, upon submission creates a record in my MS Sql database. Each record is comprised of 31 fields. I want to use a datagrid to display the data. My challenge is to restructure the data before it is displayed. For example, in my survey I am ranking 31 topics by 1 to 5 using RadioListbutton controls. So the data gets written to the database like so:

    id Topic1 Topic2 Topic3 Topic4 Topic5 Topic6 Topic7........
    1 5 5 3 2 5 2 1 -->Represents the ranking
    2 1 5 5 2 1 4 4
    3 4 4 3 5 2 4 5
    4 5 5 4 1 3 2 2

    When I pull the data out into the datagrid, I want to display it like so:

    Topics 5 4 3 2 1

    Topic1 190 205 216 139 143 -->represents the number of persons voting
    Topic2 207 196 194 115 134
    Topic3 199 185 198 114 146

    I apologize for being verbose but any help is greatly appreciated.
     
    Mike Harris, Jan 11, 2005
    #1
    1. Advertisements

  2. Interesting, I did a similar formatting once, But it would be good if you
    could put down your examples properly... I believe curretly its overlapping
    cause of the less width??
    R.Thomas

    "Mike Harris" wrote:

    > I built a survey that, upon submission creates a record in my MS Sql database. Each record is comprised of 31 fields. I want to use a datagrid to display the data. My challenge is to restructure the data before it is displayed. For example, in my survey I am ranking 31 topics by 1 to 5 using RadioListbutton controls. So the data gets written to the database like so:
    >
    > id Topic1 Topic2 Topic3 Topic4 Topic5 Topic6 Topic7........
    > 1 5 5 3 2 5 2 1 -->Represents the ranking
    > 2 1 5 5 2 1 4 4
    > 3 4 4 3 5 2 4 5
    > 4 5 5 4 1 3 2 2
    >
    > When I pull the data out into the datagrid, I want to display it like so:
    >
    > Topics 5 4 3 2 1
    >
    > Topic1 190 205 216 139 143 -->represents the number of persons voting
    > Topic2 207 196 194 115 134
    > Topic3 199 185 198 114 146
    >
    > I apologize for being verbose but any help is greatly appreciated
     
    R. Thomas, aka Xtreme.Net, Jan 12, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kate

    displaying data in a textbox

    Kate, Aug 13, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,162
    Carl Prothman [MVP]
    Aug 13, 2003
  2. JL
    Replies:
    1
    Views:
    1,502
  3. Jeff Seale
    Replies:
    0
    Views:
    573
    Jeff Seale
    Mar 5, 2005
  4. vinayak

    Displaying data in datagrid problem

    vinayak, Jul 26, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    721
    Carl Prothman [MVP]
    Jul 28, 2003
  5. Nedu N
    Replies:
    1
    Views:
    488
    Henrik Grotle
    Sep 18, 2003
  6. Nedu N
    Replies:
    2
    Views:
    476
    Mark Schubert
    Nov 19, 2003
  7. .Net Sports

    datagrid not displaying data table data

    .Net Sports, Aug 30, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,972
    .Net Sports
    Aug 31, 2005
  8. Replies:
    0
    Views:
    226
Loading...