Example #1
0
        /// <summary>
        /// Handles the SelectedIndexChanged event of the ddlPeriodTrack control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
        protected void ddlPeriod_SelectedIndexChanged(object sender, EventArgs e)
        {
            int periodId = ddlPeriod.SelectedValueAsInt() ?? 0;
            var trackQry = new ResidencyService <Track>().Queryable().Where(a => a.PeriodId.Equals(periodId));

            ddlTrack.DataSource = trackQry.OrderBy(a => a.DisplayOrder).ThenBy(a => a.Name).ToList();
            ddlTrack.DataBind();
            ddlTrack_SelectedIndexChanged(null, null);
        }