/// <summary> /// Bind data to the edit item template. We have to retrieve the calendar object from session state and /// retrieve the exception item from it to set the values in the Recurrence Pattern web server control. /// </summary> /// <param name="source">The source of the event</param> /// <param name="e">The event arguments</param> protected void dgExceptions_ItemDataBound(object sender, DataGridItemEventArgs e) { if (e.Item.ItemType == ListItemType.EditItem) { RecurringObject ro = GetCurrentObject(); RecurrencePattern rpException = (RecurrencePattern)e.Item.FindControl("rpException"); rpException.SetRecurrence(ro.ExceptionRules[e.Item.ItemIndex].Recurrence); rpException.Focus(); } }