title: Change Colour of Cells in DataGridView according to current/expired Time only
body: <p>I'm working with datagridview which is populated from an excel file source.</p>
  
  <p>I have a column "Time". I want to change colour of Cells in column "Time" So that the expired Time (cells) are coloured gray and next available times (cells) are green etc.</p>
  
  <p>I feel its more complicated than I think it is, as the time entered in Excel represents a date too even though currently its only entered as hh:mm AM/PM format. Also DateTime.Now brings up the System Date + Time.</p>
  
  <p>Example:</p>
  
  <p>Right now its 11PM (current time, anything before this is expired). The Cells in column "Time" have values which are earlier and later than the current time. 10:52PM and ealier are all expired now and 11:50pm and later are all available time slots. </p>
  
  <pre><code>   public Form1()
      {
          InitializeComponent();
          dataGridView1.CellPainting += dataGridView1_CellPainting;
      }
  </code></pre>
  
  <p>///////////////////////////////////</p>
  
  <pre><code>   private void loadListBox4()
      {
          System.Data.OleDb.OleDbConnection MyConnection;
          System.Data.DataSet DtSet;
          System.Data.OleDb.OleDbDataAdapter MyCommand;
          MyConnection = new System.Data.OleDb.OleDbConnection(@"provider=Microsoft.Jet.OLEDB.4.0;Data Source= C:\Users\Dell\Documents\BusTimingExcel.xls;Extended Properties=Excel 8.0;");
          MyCommand = new System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection);
          //MyCommand.TableMappings.Add("Route", "Location");
          DtSet = new System.Data.DataSet();
          MyCommand.Fill(DtSet);
          dataGridView1.DataSource = DtSet.Tables[0];
          MyConnection.Close();
  
          dataGridView1.Columns["Time"].DefaultCellStyle.Format = "t";
          dataGridView1.AllowUserToAddRows = false;
          dataGridView1.AllowUserToDeleteRows = false;
          dataGridView1.AllowUserToOrderColumns = true;
          dataGridView1.ReadOnly = true; ;
  
          DataView dv;
          dv = new DataView(DtSet.Tables[0], "Station = 'Poets Estate, The Dove'", "Time", DataViewRowState.CurrentRows);
          dataGridView1.DataSource = dv;
  
      }
  }
  </code></pre>