/// <summary> /// Binds the scheduled jobs. /// </summary> private void BindGrid() { var jobService = new ServiceJobService(new RockContext()); SortProperty sortProperty = gScheduledJobs.SortProperty; if (sortProperty != null) { gScheduledJobs.DataSource = jobService.GetAllJobs().Sort(sortProperty).ToList(); } else { gScheduledJobs.DataSource = jobService.GetAllJobs().OrderByDescending(a => a.LastRunDateTime).ThenBy(a => a.Name).ToList(); } gScheduledJobs.DataBind(); }