private void ViewCompletedTasksForm_Load(object sender, EventArgs e)
        {
            DataSet ds = TaskController.completedReport(theUser.userID, parameter.getStart(), parameter.getEnd());

            //begin for grid data
            dataGridView1.AutoGenerateColumns = true;
            dataGridView1.AutoResizeColumns();// = true;
            dataGridView1.DataSource = ds.Tables["tasks"];
            dataGridView1.ReadOnly   = true;

            dataGridView1.Columns[0].Visible = false;
            dataGridView1.Columns[1].Visible = false;
            dataGridView1.Columns[2].Visible = false;
            //dataGridView1.Columns[7].Visible = false;
            dataGridView1.Columns[8].Visible  = false;
            dataGridView1.Columns[9].Visible  = false;
            dataGridView1.Columns[10].Visible = false;
            dataGridView1.Columns[11].Visible = false;

            dataGridView1.Columns[3].HeaderText = "Task";
            dataGridView1.Columns[4].HeaderText = "Created Date";
            dataGridView1.Columns[5].HeaderText = "Completed Date";
            dataGridView1.Columns[6].HeaderText = "Due Date";
            dataGridView1.Columns[7].HeaderText = "On Time?";
            dataGridView1.CellFormatting       += DataGridView1_CellFormatting;
        }
Example #2
0
        private void ViewAverageTimePerTask_Load(object sender, EventArgs e)
        {
            DataSet ds = TaskController.averageTimeReport(theUser.userID, parameter.getStart(), parameter.getEnd());

            //begin for grid data
            dataGridView1.AutoGenerateColumns = true;
            dataGridView1.AutoResizeColumns();// = true;
            dataGridView1.DataSource = ds.Tables["tasks"];
            dataGridView1.ReadOnly   = true;

            dataGridView1.Columns[4].Visible = false;
            dataGridView1.Columns[5].Visible = false;


            dataGridView1.Columns[0].HeaderText = "Task";
            dataGridView1.Columns[1].HeaderText = "Number of Sessions";
            dataGridView1.Columns[2].HeaderText = "Average Time";
            dataGridView1.Columns[3].HeaderText = "Total Time";

            dataGridView1.CellFormatting += DataGridView1_CellFormatting;
        }