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

  • 相关阅读:
    Java中的subList方法
    某同学工作之后的感悟
    存放80000000学生成绩的集合,怎么统计平均分性能高
    为了金秋那沉甸甸的麦穗,我绝不辜负春天
    subList?? subString???
    "爸妈没多大本事"……
    中秋节支付宝口令红包解析
    算法>动态规划(一) 小强斋
    数据结构>优先队列(堆) 小强斋
    算法>贪心算法 小强斋
  • 原文地址:https://www.cnblogs.com/emanlee/p/1525792.html
Copyright © 2011-2022 走看看