protected virtual void OnItemDataBound(AccordionItemEventArgs args) { if (ItemDataBound != null) { ItemDataBound(this, args); } }
protected virtual void OnItemCreated(AccordionItemEventArgs args) { if (ItemCreated != null) { ItemCreated(this, args); } }
protected void accordion_ItemDataBound(object sender, AjaxControlToolkit.AccordionItemEventArgs e) { if (e == null) { throw new ArgumentNullException(nameof(e)); } if (e.ItemType == AjaxControlToolkit.AccordionItemType.Content) { Controls_ChecklistControls_ChecklistItem ckli = (Controls_ChecklistControls_ChecklistItem)LoadControl("~/Controls/ChecklistControls/ChecklistItem.ascx"); e.AccordionItem.Controls.Add(ckli); ckli.NoHeader = true; ckli.DataItem = ((ContainerRow)e.AccordionItem.DataItem); } }
protected void Accordion2_ItemDataBound(object sender, AccordionItemEventArgs e) { if (e.ItemType == AccordionItemType.Content) { Repeater r1 = e.AccordionItem.FindControl("Repeater1") as Repeater; Repeater r2 = e.AccordionItem.FindControl("Repeater2") as Repeater; SqlDataSource sd1 = e.AccordionItem.FindControl("AdjustmentViewDataSource1") as SqlDataSource; SqlDataSource sd2 = e.AccordionItem.FindControl("AdjustmentViewDataSource2") as SqlDataSource; r1.DataSource = sd1; r2.DataSource = sd2; r1.DataBind(); r2.DataBind(); } }
/// <summary> /// Create an AccordionPane's item (either Header or Content) and raise the ItemCreated event /// </summary> /// <param name="dataItem">Item's data</param> /// <param name="index">Index</param> /// <param name="itemType">Type of the item (Header or Content)</param> /// <param name="container">Control to fill</param> /// <param name="template">Template for the binding</param> /// <param name="dataBind">Whether or not to bind</param> private void CreateItem(object dataItem, int index, AccordionItemType itemType, AccordionContentPanel container, ITemplate template, bool dataBind) { if (template == null) return; AccordionItemEventArgs itemArgs = new AccordionItemEventArgs(container, itemType); OnItemCreated(itemArgs); container.SetDataItemProperties(dataItem, index, itemType); template.InstantiateIn(container); if (dataBind) { container.DataBind(); OnItemDataBound(itemArgs); } }
/// <summary> /// Raise the ItemDataBound event /// </summary> /// <param name="args">EventArgs</param> protected virtual void OnItemDataBound(AccordionItemEventArgs args) { if (ItemDataBound != null) ItemDataBound(this, args); }
/// <summary> /// Raise the ItemCreatedEvent /// </summary> /// <param name="args">EventArgs</param> protected virtual void OnItemCreated(AccordionItemEventArgs args) { if (ItemCreated != null) ItemCreated(this, args); }
protected void MyAccordion_ItemCreated(object sender, AjaxControlToolkit.AccordionItemEventArgs e) { }