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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Merge two Header Column

Merge two Header Column

Scheduled Pinned Locked Moved C#
csharphelplearning
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.
  • K Offline
    K Offline
    kaasir_2
    wrote on last edited by
    #1

    Hi, I am beginner to c#.net. I am engaged in a project (part of HR Management), and i am stucked in a small problem. The problem is, Leave is provided to employee. I have to display the leave statics of the employee in a manner show below ------------------- | LEAVE | => this is dataGridView Header ------------------- | USED | REMAINING | => this and remaining are dataGridVeiw cells. ------------------- | | | ------------------- | | | ------------------- | | | ------------------- | | | ------------------- Thank you.

    A D H 3 Replies Last reply
    0
    • K kaasir_2

      Hi, I am beginner to c#.net. I am engaged in a project (part of HR Management), and i am stucked in a small problem. The problem is, Leave is provided to employee. I have to display the leave statics of the employee in a manner show below ------------------- | LEAVE | => this is dataGridView Header ------------------- | USED | REMAINING | => this and remaining are dataGridVeiw cells. ------------------- | | | ------------------- | | | ------------------- | | | ------------------- | | | ------------------- Thank you.

      A Offline
      A Offline
      Ankur m
      wrote on last edited by
      #2

      Check this out: Merge Header - Gridview/DataGrid[^]. I hope this is what you want. :thumbsup:

      ..Go Green..

      1 Reply Last reply
      0
      • K kaasir_2

        Hi, I am beginner to c#.net. I am engaged in a project (part of HR Management), and i am stucked in a small problem. The problem is, Leave is provided to employee. I have to display the leave statics of the employee in a manner show below ------------------- | LEAVE | => this is dataGridView Header ------------------- | USED | REMAINING | => this and remaining are dataGridVeiw cells. ------------------- | | | ------------------- | | | ------------------- | | | ------------------- | | | ------------------- Thank you.

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        The DataGridView doesn't support cell merging natively. You have to custom draw the headers of the DGV yourself. Since you're a beginner, I don't know if this is going to help or even make sense to you, but there's a code example here[^].

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008
        But no longer in 2009...

        1 Reply Last reply
        0
        • K kaasir_2

          Hi, I am beginner to c#.net. I am engaged in a project (part of HR Management), and i am stucked in a small problem. The problem is, Leave is provided to employee. I have to display the leave statics of the employee in a manner show below ------------------- | LEAVE | => this is dataGridView Header ------------------- | USED | REMAINING | => this and remaining are dataGridVeiw cells. ------------------- | | | ------------------- | | | ------------------- | | | ------------------- | | | ------------------- Thank you.

          H Offline
          H Offline
          Henry Minute
          wrote on last edited by
          #4

          By trying to use a grid with effectively 2 header rows I feel that you are overcomplicating things. IMHO you would be better off by creating a custom control. Place a label on the control set its dock property to Top and Text to 'Leave'. Place a grid on the control set its dock property to fill. You can then use the grid as it was intended to be used and also have the added advantage that you can set the Font for 'Leave' independently from the font of the grid and even make the background for 'Leave' to be a pretty blue or green or whatever. Just my 2 cents. :)

          Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

          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