private void dgvHistoryReport_RowPrePaint(object sender, DataGridViewRowPrePaintEventArgs e)
 {
     if (e.RowIndex >= 0 && bsHistoryReport.DataSource != null && bsHistoryReport.Count > e.RowIndex)
     {
         HistoryMoving row = (HistoryMoving)bsHistoryReport[e.RowIndex];
         dgvHistoryReport.Rows[e.RowIndex].DefaultCellStyle.ForeColor          = row.Color;
         dgvHistoryReport.Rows[e.RowIndex].DefaultCellStyle.SelectionBackColor = row.Color;
     }
 }
        private void dtpDateTo_ValueChanged(object sender, EventArgs e)
        {
            if (cboxCargo.SelectedItem != null)
            {
                Cargo cargo = (Cargo)cboxCargo.SelectedItem;

                bsHistoryReport.DataSource = HistoryMoving.LoadList(Database, dtpDateFrom.Value, dtpDateTo.Value, tboxVehicleMask.Text, cargo);
            }
        }
 private void bsHistoryReport_CurrentChanged(object sender, EventArgs e)
 {
     if (bsHistoryReport.Current != null && panelHistoryReport.Visible)
     {
         HistoryMoving historyMoving = (HistoryMoving)bsHistoryReport.Current;
         ShowComment(historyMoving.GetComment(Database));
         ShowCreator(historyMoving.GetPlanAppointCreator(Database));
     }
     else
     {
         ShowComment("");
         ShowCreator("");
     }
 }