/// <summary> /// Handles the Delete event of the gChildContentChannels control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="RowEventArgs" /> instance containing the event data.</param> protected void gChildContentChannels_Delete(object sender, RowEventArgs e) { int childContentChannelId = e.RowKeyId; ChildContentChannelsList.Remove(childContentChannelId); BindChildContentChannelsGrid(); }
/// <summary> /// Binds the child content channels grid. /// </summary> private void BindChildContentChannelsGrid() { var contentChannelList = new ContentChannelService(new RockContext()) .Queryable() .Where(t => ChildContentChannelsList.Contains(t.Id)) .OrderBy(t => t.Name) .ToList(); gChildContentChannels.DataSource = contentChannelList; gChildContentChannels.DataBind(); }
/// <summary> /// Handles the Add event of the gChildContentChannels 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 gChildContentChannels_Add(object sender, EventArgs e) { // populate dropdown with all grouptypes that aren't already childgroups var contentChannelList = new ContentChannelService(new RockContext()) .Queryable() .Where(t => !ChildContentChannelsList.Contains(t.Id)) .OrderBy(t => t.Name) .ToList(); if (contentChannelList.Count == 0) { modalAlert.Show("There are not any other content channels that can be added", ModalAlertType.Warning); } else { ddlChildContentChannel.DataSource = contentChannelList; ddlChildContentChannel.DataBind(); ShowDialog("ChildContentChannels"); } }
/// <summary> /// Handles the SaveClick event of the dlgChildContentChannel 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 dlgChildContentChannel_SaveClick(object sender, EventArgs e) { ChildContentChannelsList.Add(ddlChildContentChannel.SelectedValueAsId() ?? 0); BindChildContentChannelsGrid(); HideDialog(); }