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. Merging Header Values In Datagrid

Merging Header Values In Datagrid

Scheduled Pinned Locked Moved ASP.NET
question
5 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.
  • N Offline
    N Offline
    Nickson
    wrote on last edited by
    #1

    Does anyone know if it is possible to merge 2 cells together to show as a single heading? The data should continue to show as 2 separate columns under the merge header. rgds, Nickson

    J P 2 Replies Last reply
    0
    • N Nickson

      Does anyone know if it is possible to merge 2 cells together to show as a single heading? The data should continue to show as 2 separate columns under the merge header. rgds, Nickson

      J Offline
      J Offline
      Jeremy Oldham
      wrote on last edited by
      #2

      Nickson, I know you can set a header cell to span 2 columns with the following: If e.Item.ItemType = ListItemType.Header Then e.Item.Cells(0).ColumnSpan = 2 End If The problem then becomes deleting the e.itme.cells(1). This example will push all header columns over. I have tried to find code to delete the second cell, but I have had no sucess. Hopefully thought this will give you a head start and someone else can provide the rest of the answer. Jeremy Oldham

      1 Reply Last reply
      0
      • N Nickson

        Does anyone know if it is possible to merge 2 cells together to show as a single heading? The data should continue to show as 2 separate columns under the merge header. rgds, Nickson

        P Offline
        P Offline
        Paul Riley
        wrote on last edited by
        #3

        Nickson wrote: Does anyone know if it is possible to merge 2 cells together to show as a single heading? Go into the HTML view and replace the two BoundColumns with a single TemplateColumn, showing whatever data you want in whatever format you want. Paul We all will feed the worms and trees
        So don't be shy
        - Queens of the Stone Age, Mosquito Song

        N 1 Reply Last reply
        0
        • P Paul Riley

          Nickson wrote: Does anyone know if it is possible to merge 2 cells together to show as a single heading? Go into the HTML view and replace the two BoundColumns with a single TemplateColumn, showing whatever data you want in whatever format you want. Paul We all will feed the worms and trees
          So don't be shy
          - Queens of the Stone Age, Mosquito Song

          N Offline
          N Offline
          Nickson
          wrote on last edited by
          #4

          Hmmm... still couldn't figure out how to do it? :confused: Now got another question instead? Can I add another header row to a datagrid. (see example below which is actually what i want to achieve) Jan Name 1st 2nd 3rd 4th --------------------- John 0 1 3 6 Mary 1 3 5 7 Should i use datagrid in the above case? Rlly need ur expert advise ;) rgds, Nickson

          P 1 Reply Last reply
          0
          • N Nickson

            Hmmm... still couldn't figure out how to do it? :confused: Now got another question instead? Can I add another header row to a datagrid. (see example below which is actually what i want to achieve) Jan Name 1st 2nd 3rd 4th --------------------- John 0 1 3 6 Mary 1 3 5 7 Should i use datagrid in the above case? Rlly need ur expert advise ;) rgds, Nickson

            P Offline
            P Offline
            Paul Riley
            wrote on last edited by
            #5

            Nickson wrote: Hmmm... still couldn't figure out how to do it? I think it's probably a good idea that you do; I think it'll answer your new question as well. If you can send me an example of exactly what you want to do (make it by email to pdriley@santt.com, if you want, so we can use attachments and don't have to worry about asp tags getting lost in the message) then I can give you a better idea of how to do it. Paul We all will feed the worms and trees
            So don't be shy
            - Queens of the Stone Age, Mosquito Song

            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