zoukankan      html  css  js  c++  java
  • Removing Page Size control From RadGrid

    We've noticed some changes and one of it is the "page size" control(dropdownlist) appears in the footer of the RadGrid if the pagerstyle mode is set to "NextPrevAndNumeric". Is there any way to remove this "page size" control as we don't actually need it as most of our RadGrid already has its own "page size" control.

    Solution 1(C# Codes):

    You can either disable the page size combobox so that the user cannot change the page size:

    protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)

    {

          if (e.Item is GridPagerItem)

            {

                GridPagerItem pagerItem = (GridPagerItem)e.Item;

                RadComboBox combo = (RadComboBox)pagerItem.FindControl("PageSizeComboBox");

                combo.Visible= false;         

            }

    }

    Solution 2(CSS):

    or , Try adding following CSS in order to hide the pagesize dropdown in grid (Change Page Size and other Advanced function will be hidden).

    div.RadGrid .rgPager .rgAdvPart
    {
         display: none;
    }

    If I use a PagerStyle mode of  NextPrevAndNumeric everything works just fine.  I would like to be able to use the mode of

    NextPrevNumericAndAdvanced.  However the "Page xxxx of xxxx GO" could not be seen. Therefore, I changed the CSS as below:

    /*div.RadGrid .rgPager .rgAdvPart,
    {
         display: none;
    }*/

    #ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_ChangePageSizeLabel,
    #ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_ChangePageSizeTextBox_wrapper,
    #ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_ChangePageSizeTextBox_text,
    #ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_ChangePageSizeLinkButton
    {
         display: none;
    }

    or

    div.RadGrid .rgPager .rgAdvPart
    {
        display: none;
    }

    #ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_GoToPageLabel, #ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_GoToPageTextBox_wrapper, #ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_GoToPageTextBox_text, #ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_GoToPageTextBox, #ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_GoToPageTextBox_Value, #ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_GoToPageTextBox_ClientState, #ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_PageOfLabel, #ctl00_ContentPlaceHolder1_RadGrid1_ctl00_ctl03_ctl01_GoToPageLinkButton
    {
        display: inline;
    }

    REF:

    http://www.telerik.com/community/forums/aspnet-ajax/grid/how-to-remove-quot-page-size-quot-dropdown.aspx

  • 相关阅读:
    myeclipse web 包名保留字与servlet冲突
    java.lang.IllegalStateException
    request 和response 中的setCharacterEncoding区别
    java.lang.ClassNotFoundException: com.servlet.HandlesearchclassesServlet
    sql server 2008 com.microsoft.sqlserver.jdbc.SQLServerException: 通过端口 1433 连接到主机
    理解java reference
    Java 内存区域和GC机制
    Tomcat配置HTTPS方式
    百度分享不支持https的解决方案
    Spring对Hibernate事务管理
  • 原文地址:https://www.cnblogs.com/emanlee/p/1525792.html
Copyright © 2011-2022 走看看