or
if (e.Command == SchedulerNavigationCommand.NavigateToNextPeriod || e.Command == SchedulerNavigationCommand.NavigateToPreviousPeriod || e.Command == SchedulerNavigationCommand.NavigateToSelectedDate || e.Command == SchedulerNavigationCommand.SwitchToSelectedDay){ using (ServicoAnosLectivos servico = new ServicoAnosLectivos()) { DateTime[] datas = servico.GetDatasAnoLectivo(ServicoTabelasBaseSistema.GetAnoLectivoActual(true)); if (e.SelectedDate < datas[0] || e.SelectedDate > datas[1]) { e.Cancel = true; } }}protected void Page_Load(object sender, EventArgs e){ grdSearch.DataSource = dsSearchMeetingList.Tables[0]; grdSearch.DataBind();}protected void grdSearch_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e){ GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem; int iGolalId = Convert.ToInt32(dataItem.GetDataKeyValue("Pk_Id").ToString()); grdSearch.DataSource = objViewMaintenance.GetDetailGoals(iGolalId); ;}