title: Merge mulitple row Headers in a DatagridView with C#
body: <p>I have a Project where I need to view data in Datagridview from a Database and it should look like a Gantt Chart. </p>
  
  <p>I would like to let the Datagridview look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/w4oQM.png" rel="nofollow noreferrer">Datagridview example</a></p>
  
  <p>I already tried a lot of code from the internet, but nothing worked properly</p>
  
  <p>For example this one:
  <a href="https://social.msdn.microsoft.com/Forums/windows/en-US/87004d70-482a-4b86-ba18-371670254b6a/how-to-merge-headers-in-a-datagridview?forum=winformsdatacontrols" rel="nofollow noreferrer">https://social.msdn.microsoft.com/Forums/windows/en-US/87004d70-482a-4b86-ba18-371670254b6a/how-to-merge-headers-in-a-datagridview?forum=winformsdatacontrols</a></p>
  
  <p>Also I don't know how to get the day values into the cells/row header</p>
  
  <p>This is how I get the days from a month</p>
  
  <pre><code>int year = DateTime.Now.Year;
  int Jan = 1;
  int daysInJan = System.DateTime.DaysInMonth(year, Jan);
  </code></pre>