예제 #1
0
 protected override void OnPreInit(EventArgs e)
 {
     if (PreviousPage != null)
     {
         if (PreviousPage.IsCrossPagePostBack == true)
         {
             string pagerObj = (PreviousPage.FindControl("hidPagerObject") as HtmlInputHidden).Value;
             Session["pagerClss"] = pagerObj;
             //Tools.GetDeluxePager(DeluxePager1, pagerObj, ref ppc);
             ppc = Tools.GetPagerProperties(pagerObj);
             Tools.SetClientPagerProperties(DeluxePager1, ppc);
         }
     }
     if (Session["pagerClss"] != null)
     {
         Tools.GetDeluxePager(DeluxePager1, Session["pagerClss"].ToString(), ref ppc);
     }
     base.OnPreInit(e);
 }
예제 #2
0
        protected void btnSetProperties_Click(object sender, EventArgs e)
        {
            if (this.txtControlID.Text == null || this.txtControlID.Text.Trim().Length == 0)
            {
                return;
            }
            if (this.txtPageSize.Text == null || this.txtPageSize.Text.Trim().Length == 0)
            {
                return;
            }
            IControls          controls = new Controls();
            PagerPropertiesCls ppc      = new PagerPropertiesCls();

            ppc.BoundControlID = txtControlID.Text;
            ppc.GotoButtonText = txtGotoButtonText.Text == "" ? "Ìøתµ½" : txtGotoButtonText.Text;

            switch (ddlPageCodeMode.SelectedValue)
            {
            case "RecordCount":
                ppc.PagerCodeMode = PagerCodeShowMode.RecordCount;
                break;

            case "CurrentRecordCount":
                ppc.PagerCodeMode = PagerCodeShowMode.CurrentRecordCount;
                break;

            case "All":
                ppc.PagerCodeMode = PagerCodeShowMode.All;
                break;
            }

            switch (ddlPageMode.SelectedValue)
            {
            case "0":
                ppc.PagerButtonsMode = DeluxePagerMode.Numeric;
                break;

            case "1":
                ppc.PagerButtonsMode = DeluxePagerMode.NextPreviousFirstLast;
                break;
            }

            ppc.IsDataSourceControl = ddlIDataSource.SelectedValue == "yes" ? true : false;
            ppc.IsPagedControl      = ddlPageControl.SelectedValue == "yes" ? true : false;

            if (txtFPIUrl.Text != "")
            {
                ppc.FirstPageImageUrl = txtFPIUrl.Text;
            }
            if (txtFPText.Text != "")
            {
                ppc.FirstPageText = txtFPText.Text;
            }
            if (txtLPIUrl.Text != "")
            {
                ppc.LastPageImageUrl = txtLPIUrl.Text;
            }
            if (txtLPText.Text != "")
            {
                ppc.LastPageText = txtLPText.Text;
            }
            if (txtNPIUrl.Text != "")
            {
                ppc.NextPageImageUrl = txtNPIUrl.Text;
            }
            if (txtNPText.Text != "")
            {
                ppc.NextPageText = txtNPText.Text;
            }
            if (txtPPIUrl.Text != "")
            {
                ppc.PreviousPageImageUrl = txtPPIUrl.Text;
            }
            if (txtPPText.Text != "")
            {
                ppc.PreviousPageText = txtPPText.Text;
            }
            if (txtPageSize != null && txtPageSize.Text.Trim().Length > 0)
            {
                ppc.PageSize = Convert.ToInt32(txtPageSize.Text);
            }

            Tools tools = new Tools();

            byte[] b   = Tools.SerializeBinary(ppc);
            string str = "";

            for (int i = 0; i < b.Length; i++)
            {
                str += b[i] + ";";
            }
            str = str.TrimEnd(';');
            hidPagerObject.Value = str;

            btnGoto.PostBackUrl = controls.InitializeControls(ddlControlType.SelectedValue, ppc);
            //this.btnGoto.OnClientClick = "window.open(this.PostBackUrl,'','top=0,left=0,width=780,height=480,menubar=no,toolbar=no,location=no,scrollbars=yes,resizable=yes,status=no');return false;";
        }