/// <summary> /// Handles the Load event of the Page control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { MyListView.CurrentListView.PrimaryKeyId = EcfListView.MakePrimaryKeyIdString("CatalogEntryId", "ClassTypeId"); LoadDataAndDataBind(); InitDataSource(_StartRowIndex, _MaximumRows, true, MyListView.CurrentListView.SortExpression); DataBind(); } if (String.Compare(Request.Form["__EVENTTARGET"], CommandManager.GetCurrent(this.Page).ID, false) == 0) { InitDataSource(_StartRowIndex, _MaximumRows, true, MyListView.CurrentListView.SortExpression); DataBind(); } //Update column header HtmlTableRow headerTRow = MyListView.InnerListViewTableHeader; if (headerTRow != null) { List <Label> labels = ManagementHelper.CollectControls <Label>(headerTRow); foreach (Label label in labels) { if (ddlFieldList.Items.Count > 0) { label.Text = ddlFieldList.SelectedItem == null ? ddlFieldList.Items[0].Text : ddlFieldList.SelectedItem.Text; } } } }
/// <summary> /// Processes the item update command. /// </summary> /// <param name="items">The items.</param> void ProcessItemUpdateCommand(ListViewItem item) { List <TemplateControl> ctrls = ManagementHelper.CollectControls <TemplateControl>(item); foreach (Control ctrl in ctrls) { IBatchUpdateControl buctrl = ctrl as IBatchUpdateControl; if (buctrl != null) { buctrl.Update(); } } }
void CurrentListView_ItemCreated(object sender, ListViewItemEventArgs e) { if (e.Item.ItemType == ListViewItemType.DataItem) { List <TemplateControl> ctrls = ManagementHelper.CollectControls <TemplateControl>(e.Item); foreach (Control ctrl in ctrls) { IBatchUpdateControl buctrl = ctrl as IBatchUpdateControl; if (buctrl != null) { buctrl.FieldName = ddlFieldList.SelectedValue.Split('$')[0]; buctrl.IsMetaField = bool.Parse(ddlFieldList.SelectedValue.Split('$')[1]); buctrl.LanguageCode = ListLanguages.SelectedValue; buctrl.CatalogNodeId = CatalogNodeId; } } } }