Math Ew

Math Ew

  • NA
  • 5
  • 7.6k

Vacation Gantt Chart on DataGrid

Jul 2 2014 3:46 PM
I have a datagrid on my window. I would like to create some kind of a gantt chart on it to review holidays logged into the database. My code attached.

My schema:

  1. An employee selects the type of holiday + Start date and End Date.
  2. The code checks whether the database records are located between the start date and end date.
  3. After finding - fill DataGird records with dates and type of leave.
  4. The names of columns (after the fixed columns) are the days of the month of selected holiday.
  5. the code colors cells to the appropriate color that correspond to the start and end date if someone has vacation in that day.

The last point is not working properly. Code creates a column but for each row separately and colorizes badly.

this is what I get:


 I wonder whether the use of a DataGrid is a good idea? Or should I use other control?

Thank you very much for your help!


Attachment: filldg.rar

Answers (2)