Пример #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 || String.Compare(Request.Form["__EVENTTARGET"], CommandManager.GetCurrent(this.Page).ID, false) == 0)
            {
                LoadDataAndDataBind(MyListView.CurrentListView.SortExpression);
            }

            if (MyListView.CurrentListView.Items.Count == 0)
            {
                // register commands
                ManagementHelper.RegisterCommandsForView(this.Page, MyListView.AppId, MyListView.ViewId);
            }
        }