Friday, December 18, 2015

Telerik Controls : Hiding PageSize functionality in Telerik RadGrid Control


Hiding the “PageSize” Option under RadGrid not to change the Page Size in RadGrid
 

Want to share the code snippet to hide the same.

 

protected void rgContractorsListAll_ItemDataBound(object sender, GridItemEventArgs e)

{

            #region GridPagerItem

            if (e.Item is GridPagerItem)

            {

                GridPagerItem pager = (GridPagerItem)e.Item;

                Label lblPageSize = (Label)pager.FindControl("ChangePageSizeLabel");

                if(lblPageSize != null)

                    lblPageSize.Visible = false;

 

                RadNumericTextBox txtPageSize = (RadNumericTextBox)pager.FindControl("ChangePageSizeTextBox");

                if (txtPageSize != null)

                    txtPageSize.Visible = false;

 

                Button btnChangePageSize = (Button)pager.FindControl("ChangePageSizeLinkButton");

                if (btnChangePageSize != null)

                    btnChangePageSize.Visible = false

            }

            #endregion

}

No comments:

Post a Comment