/// <summary>
        /// Binds the grid.
        /// </summary>
        private void BindGrid()
        {
            var dateRange = SlidingDateRangePicker.CalculateDateRangeFromDelimitedValues(drpSlidingDateRange.DelimitedValues);

            string groupIds  = GetSelectedGroupIds().AsDelimited(",");
            string campusIds = cpCampuses.SelectedCampusIds.AsDelimited(",");

            SortProperty sortProperty = gAttendance.SortProperty;

            var chartData = new AttendanceService(new RockContext()).GetChartData(
                hfGroupBy.Value.ConvertToEnumOrNull <AttendanceGroupBy>() ?? AttendanceGroupBy.Week,
                hfGraphBy.Value.ConvertToEnumOrNull <AttendanceGraphBy>() ?? AttendanceGraphBy.Total,
                dateRange.Start,
                dateRange.End,
                groupIds,
                campusIds);

            if (sortProperty != null)
            {
                gAttendance.DataSource = chartData.AsQueryable().Sort(sortProperty).ToList();
            }
            else
            {
                gAttendance.DataSource = chartData.OrderBy(a => a.DateTimeStamp).ToList();
            }

            gAttendance.DataBind();
        }