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

  • 相关阅读:
    红黑树(二)之 C语言的实现
    红黑树(一)之 原理和算法详细介绍
    Design and Evaluation of an RDMA-aware Data Shuffling Operator for Parallel Database Systems
    RDMA Technology White Paper
    InfiniBand: An Introduction + Simple IB verbs program with RDMA Write
    crc32_offload_api_example
    Programming Examples Using IBV Verbs
    15. RDMA之RoCE & Soft-RoCE
    14. RDMA之Memory Window
    13. RDMA之用户态与内核态交互
  • 原文地址:https://www.cnblogs.com/emanlee/p/1525792.html
Copyright © 2011-2022 走看看