Esempio n. 1
0
 /// <summary>
 /// Get the actual grid page size fro a given GridView and given employee
 /// </summary>
 /// <param name="GridID">The GridView name</param>
 /// <param name="UserID">The actual user name</param>
 /// <returns>The Grid page size</returns>
 public GridPageSize GetGridPageSizeState(string GridID, string UserID)
 {
     GridPageSizeDS.GPS_GetGridPageSizeDataTable table =
         GridPageSizeAdapter.GetGridPageSize(GridID, UserID);
     if (table.Rows.Count > 0)
     {
         GridPageSize theGridPageSize = new GridPageSize(table[0].gridId,
                                                         table[0].userId, table[0].pagesize);
         return(theGridPageSize);
     }
     else
     {
         return(null);
     }
 }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (AssociatedGridView == null || AssociatedGridView.Length == 0)
        {
            this.Visible = false;
            return;
        }

        string gridType = gridType = this.Parent.FindControl(AssociatedGridView).GetType().FullName;

        switch (gridType)
        {
        //case "Telerik.Web.UI.RadGrid":
        //    RadGrid theRadGrid = (RadGrid)this.Parent.FindControl(AssociatedGridView);
        //    if (theRadGrid != null)
        //    {
        //        Rows3ImageButton.Visible = Rows3;
        //        Rows5ImageButton.Visible = Rows5;
        //        Rows10ImageButton.Visible = Rows10;
        //        Rows20ImageButton.Visible = Rows20;
        //        Rows30ImageButton.Visible = Rows30;
        //        Rows50ImageButton.Visible = Rows50;

        //        GridPageSizeBLL theBLL = new GridPageSizeBLL();
        //        GridPageSize theGridPageSize = theBLL.GetGridPageSizeState(AssociatedGridView.ToString(),
        //            HttpContext.Current.User.Identity.Name);
        //        if (theGridPageSize != null)
        //        {
        //            theRadGrid.PageSize = theGridPageSize.PageSize;
        //        }
        //    }
        //    else
        //    {
        //        this.Visible = false;
        //    }
        //    break;
        case "System.Web.UI.WebControls.GridView":
            GridView theGridView = (GridView)this.Parent.FindControl(AssociatedGridView);
            if (theGridView != null)
            {
                Rows3ImageButton.Visible  = Rows3;
                Rows5ImageButton.Visible  = Rows5;
                Rows10ImageButton.Visible = Rows10;
                Rows20ImageButton.Visible = Rows20;
                Rows30ImageButton.Visible = Rows30;
                Rows50ImageButton.Visible = Rows50;

                GridPageSizeBLL theBLL          = new GridPageSizeBLL();
                GridPageSize    TheGridPageSize = theBLL.GetGridPageSizeState(AssociatedGridView.ToString(),
                                                                              HttpContext.Current.User.Identity.Name);
                if (TheGridPageSize != null)
                {
                    theGridView.PageSize = TheGridPageSize.PageSize;
                }
            }
            else
            {
                this.Visible = false;
            }
            break;

        default:
            this.Visible = false;
            break;
        }
    }