Esempio n. 1
0
        /// <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;
                    }
                }
            }
        }
Esempio n. 2
0
        /// <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();
                }
            }
        }
Esempio n. 3
0
 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;
             }
         }
     }
 }