Example #1
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.WebControls.BaseDataBoundControl.DataBound"/> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> object that contains the event data.</param>
        protected override void OnDataBound(EventArgs e)
        {
            base.OnDataBound(e);

            PagerTemplate pagerTemplate = this.PagerTemplate as PagerTemplate;

            if (PagerTemplate != null)
            {
                pagerTemplate.SetNavigation(this.PageCount, this.PageIndex, this.PageSize);
            }
        }
Example #2
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> that contains event data.</param>
        protected override void OnInit(EventArgs e)
        {
            Rock.Web.UI.Page.AddCSSLink(Page, "~/CSS/grid.css");

            PagerTemplate pagerTemplate = new PagerTemplate();

            pagerTemplate.NavigateClick     += pagerTemplate_NavigateClick;
            pagerTemplate.ItemsPerPageClick += pagerTemplate_ItemsPerPageClick;
            this.PagerTemplate = pagerTemplate;

            this.Sorting += new GridViewSortEventHandler(Grid_Sorting);
            this.Actions.ExcelExportClick += new EventHandler(Actions_ExcelExportClick);

            this.Actions.EnableExcelExport = this.ShowActionExcelExport;

            base.OnInit(e);
        }
Example #3
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> that contains event data.</param>
        protected override void OnInit( EventArgs e )
        {
            PagerTemplate pagerTemplate = new PagerTemplate();
            pagerTemplate.NavigateClick += pagerTemplate_NavigateClick;
            pagerTemplate.ItemsPerPageClick += pagerTemplate_ItemsPerPageClick;
            this.PagerTemplate = pagerTemplate;

            this.Sorting += Grid_Sorting;

            this.Actions.MergeClick += Actions_MergeClick;
            this.Actions.BulkUpdateClick += Actions_BulkUpdateClick;
            this.Actions.CommunicateClick += Actions_CommunicateClick;
            this.Actions.ExcelExportClick += Actions_ExcelExportClick;

            var rockPage = this.Page as RockPage;
            if ( rockPage != null )
            {
                int pageSize = 50;
                int.TryParse( rockPage.GetUserPreference( PAGE_SIZE_KEY ), out pageSize );
                if ( pageSize != 50 && pageSize != 500 && pageSize != 5000 )
                {
                    pageSize = 50;
                }

                base.PageSize = pageSize;
            }

            base.OnInit( e );
        }
Example #4
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> that contains event data.</param>
        protected override void OnInit( EventArgs e )
        {
            Rock.Web.UI.Page.AddCSSLink( Page, "~/CSS/grid.css" );

            PagerTemplate pagerTemplate = new PagerTemplate();
            pagerTemplate.NavigateClick += pagerTemplate_NavigateClick;
            pagerTemplate.ItemsPerPageClick += pagerTemplate_ItemsPerPageClick;
            this.PagerTemplate = pagerTemplate;

            this.Sorting += new GridViewSortEventHandler( Grid_Sorting );
            this.Actions.ExcelExportClick += new EventHandler( Actions_ExcelExportClick );

            this.Actions.EnableExcelExport = this.ShowActionExcelExport;

            base.OnInit( e );
        }