Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Not Repeated Rows

Not Repeated Rows

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasehelpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mr Wonderful
    wrote on last edited by
    #1

    Hi, I have small project that retrieve Data from Database and fill Datagrid On Page Load. I add Databound Columns for each Columns in the database, and set The AutoGenerateColumns=False, So My Data will be Displayed lik this StudentName CourseName John asp.net Mary mcse Komar MCSD Komar A+ Komar 3D Studio ... I need to make Komar appears just one time, so the result Should be like this in the DataGrid StudentName CourseName Komar MCSD A+ 3D Studio How Can I do This, some help Please.

    E C 2 Replies Last reply
    0
    • M Mr Wonderful

      Hi, I have small project that retrieve Data from Database and fill Datagrid On Page Load. I add Databound Columns for each Columns in the database, and set The AutoGenerateColumns=False, So My Data will be Displayed lik this StudentName CourseName John asp.net Mary mcse Komar MCSD Komar A+ Komar 3D Studio ... I need to make Komar appears just one time, so the result Should be like this in the DataGrid StudentName CourseName Komar MCSD A+ 3D Studio How Can I do This, some help Please.

      E Offline
      E Offline
      eyeseetee
      wrote on last edited by
      #2

      add DISTINCT to your query for StudentName, this should then just select one unique student name.

      1 Reply Last reply
      0
      • M Mr Wonderful

        Hi, I have small project that retrieve Data from Database and fill Datagrid On Page Load. I add Databound Columns for each Columns in the database, and set The AutoGenerateColumns=False, So My Data will be Displayed lik this StudentName CourseName John asp.net Mary mcse Komar MCSD Komar A+ Komar 3D Studio ... I need to make Komar appears just one time, so the result Should be like this in the DataGrid StudentName CourseName Komar MCSD A+ 3D Studio How Can I do This, some help Please.

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        A data grid is not the right choice for this. Use nested repeaters and build two collections, one of names, and one of courses for that name. Or you could just handle the data bound event for a row, and erase the name if it's the same as the last name displayed.

        Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups