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. hide repeating data

hide repeating data

Scheduled Pinned Locked Moved ASP.NET
helpquestion
4 Posts 4 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.
  • H Offline
    H Offline
    Hum Dum
    wrote on last edited by
    #1

    table data is

    col1 col2 col3 col4

    1 1a 1b 1c
    1 1a 1d 1e
    1 1b 1f 1g
    2 2a 2b 2c
    2 2a 2d 2e
    2 2b 2f 2g
    2 2b 2h 2i
    2 2b 2j 2k

    Need to format output as

    col1 col2 col3 col4

    1 1a 1b 1c
    1d 1e
    1b 1f 1g
    2 2a 2b 2c
    2d 2e
    2b 2f 2g
    2h 2i
    2j 2k

    i.e hiding repeating data. I am thinking creating a data table object then check for repeating data column, if repeat then add blank column, else add same column. Is there any other way of achieving this ? what if table contain 10000 rows ? Any logic/help/link/post will be much helpful. regards

    S A M 3 Replies Last reply
    0
    • H Hum Dum

      table data is

      col1 col2 col3 col4

      1 1a 1b 1c
      1 1a 1d 1e
      1 1b 1f 1g
      2 2a 2b 2c
      2 2a 2d 2e
      2 2b 2f 2g
      2 2b 2h 2i
      2 2b 2j 2k

      Need to format output as

      col1 col2 col3 col4

      1 1a 1b 1c
      1d 1e
      1b 1f 1g
      2 2a 2b 2c
      2d 2e
      2b 2f 2g
      2h 2i
      2j 2k

      i.e hiding repeating data. I am thinking creating a data table object then check for repeating data column, if repeat then add blank column, else add same column. Is there any other way of achieving this ? what if table contain 10000 rows ? Any logic/help/link/post will be much helpful. regards

      S Offline
      S Offline
      Shahriar Iqbal Chowdhury Galib
      wrote on last edited by
      #2

      hi, You cant hide repeating data, best you can do is represent data as group. You will find many cool js grid that represent grouped data. You can also look at these articles http://www.aspcode.net/ASPNET-grouping-repeater-control.aspx[^] A Grouping Repeater Control for ASP.NET[^] http://mattberseth.com/blog/2008/01/building_a_grouping_grid_with.html[^]

      1 Reply Last reply
      0
      • H Hum Dum

        table data is

        col1 col2 col3 col4

        1 1a 1b 1c
        1 1a 1d 1e
        1 1b 1f 1g
        2 2a 2b 2c
        2 2a 2d 2e
        2 2b 2f 2g
        2 2b 2h 2i
        2 2b 2j 2k

        Need to format output as

        col1 col2 col3 col4

        1 1a 1b 1c
        1d 1e
        1b 1f 1g
        2 2a 2b 2c
        2d 2e
        2b 2f 2g
        2h 2i
        2j 2k

        i.e hiding repeating data. I am thinking creating a data table object then check for repeating data column, if repeat then add blank column, else add same column. Is there any other way of achieving this ? what if table contain 10000 rows ? Any logic/help/link/post will be much helpful. regards

        A Offline
        A Offline
        Anurag Gandhi
        wrote on last edited by
        #3

        You can look into

        MergeRows

        function in this article: Pivoting DataTable Simplified[^] This should give a fair idea on merging rows here.

        Anurag Gandhi.
        http://www.gandhisoft.com
        Life is a computer program and every one is the programmer of his own life.
        My latest article: Group GridView Data

        1 Reply Last reply
        0
        • H Hum Dum

          table data is

          col1 col2 col3 col4

          1 1a 1b 1c
          1 1a 1d 1e
          1 1b 1f 1g
          2 2a 2b 2c
          2 2a 2d 2e
          2 2b 2f 2g
          2 2b 2h 2i
          2 2b 2j 2k

          Need to format output as

          col1 col2 col3 col4

          1 1a 1b 1c
          1d 1e
          1b 1f 1g
          2 2a 2b 2c
          2d 2e
          2b 2f 2g
          2h 2i
          2j 2k

          i.e hiding repeating data. I am thinking creating a data table object then check for repeating data column, if repeat then add blank column, else add same column. Is there any other way of achieving this ? what if table contain 10000 rows ? Any logic/help/link/post will be much helpful. regards

          M Offline
          M Offline
          Morgs Morgan
          wrote on last edited by
          #4

          hi, You can use a List collection to store the data whilst reading from the db. i don't know where you are getting the data from or how so i will assume its from the database and u are using TSQL

          /// Your sql reader
          SqlDataReader = reader.ExecuteQuery ( commandText ) ;
          /// Your list
          ArrayList aList = new ArrayList ( ) ;
          while ( reader.Read ( ))
          {
          if ( ! aList.Contains ( ( string )reader[ "rowname" ] ) )
          {
          /// Add the row to table
          }
          /// else, oh snap! skip me already been added

          }

          Good luck

          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