title: Different color based on what dropdown list value is
body: <p>I have here the annual leave tool made by Daypilot, what I did extra is I added the Type of Leave ( vacation, medical and so on ) everything worked perfect, but what I want now is to have different color for each LeaveType I have.</p>
  
  <p>I created a new table for this LeaveType, I was thinking to use an if where if the value from the database is selected set the backgroundcolor to something, but I'm not sure how I could do this.</p>
  
  <p>Default.aspx.cs:</p>
  
  <pre><code>Protected void DayPilotScheduler1_BeforeEventRender(object sender, DayPilot.Web.Ui.Events.Scheduler.BeforeEventRenderEventArgs e)
      {
          TimeSpan duration = e.End - e.Start;
          e.Html = String.Format("{0} days", duration.TotalDays);
          e.EventMoveVerticalEnabled = false;
          if (-------in this if I should maybe say that if a specific value from table "Leave" is selected in the dropdown list-----------)
          {
              e.BackgroundColor = "#00ff74";
          }
          else
          {
              e.BackgroundColor = "#00ac74";
          }
  
      }
  </code></pre>
  
  <p>I also have here this New.aspx.cs where I have this dropdownlists:</p>
  
  <pre><code>public partial class New : Page
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          if (!IsPostBack)
          {
              TextBoxStart.Text = Convert.ToDateTime(Request.QueryString["start"]).ToString("M/d/yyyy HH:mm");
              TextBoxEnd.Text = Convert.ToDateTime(Request.QueryString["end"]).ToString("M/d/yyyy HH:mm");
  
              DropDownList1.DataSource = dbGetResources();
              DropDownList1.DataTextField = "PersonName";
              DropDownList1.DataValueField = "PersonId";
              DropDownList1.SelectedValue = Request.QueryString["r"];
              DropDownList1.DataBind();
  
  
              DropDownList2.DataSource = dbGetResources1();
              DropDownList2.DataTextField = "Reasonforleave";
              DropDownList2.DataValueField = "Id";
              DropDownList2.SelectedValue = Request.QueryString["0"];
              DropDownList2.DataBind();
          }
      }
  </code></pre>
  
  <p>I would like to know how can I use that <code>DropDownList2</code>, to check what value is selected and based on that to have specific color. Or if you know a better way to do this? I expect the color of the box to be different based on the type of leave.
  Here is a screenshot with the aspect of app.</p>
  
  <p><a href="https://imgur.com/a/0brr6sA" rel="nofollow noreferrer">https://imgur.com/a/0brr6sA</a></p>
  
  <p>Thanks!</p>