"Page 1 of..." How to increase input box padding?

3 posts, 0 answers
  1. Robert
    Robert avatar
    58 posts
    Member since:
    Dec 2008

    Posted 05 May 2009 Link to this post

    Hello,

    Using Q1 2009

    I have a grid thats using the "Page 1 of 5" and the "Go" button.  Everything works fine but I was wondering if there is a way to increase the left and right padding on the input box where the "1" in this example is located.

    I've tracked down a width declaration in the final markup rendered to the page as an inline style: "style=width:7px".  My guess is the inline style is generated by the javascript.  Adding padding to the style in the grid style sheet (.RadGrid_Default .rgPagerTextBox) yields no change as would be expected because the inline style should take precedence.

    Is there any way to edit the generated inline style to perhaps make it wider?

    Thanks,
    Bob
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 05 May 2009 Link to this post

    Hello Robert,

    You can try increasing the width of the RadNumericTextBox in the pager row using the code below:
    C#:
     protected void RadGrid1_ItemDataBound (object sender, GridItemEventArgs e) 
        {   
           if (e.Item is GridPagerItem) 
            { 
                GridPagerItem pager = (GridPagerItem)e.Item;           
                ((RadNumericTextBox)pager.FindControl("GoToPageTextBox")).Width = Unit.Pixel(30);         
            } 
        } 

    Thanks
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 05 May 2009 Link to this post

    Hello Robert-

    It's interesting that you're seeing a width of 7px for your input textbox. The RadGrid skins should be setting this width to 20px by default. I bet you may have a general CSS rule (like a rule applied to all input controls) that's "cascading" on to your RadGrid and causing the unusually narrow pager textbox. Try focusing your site CSS and that should clear things up.

    If that's not an option, you can also use the CSS !important directive to change the input's width, like this:

    .RadGrid_Default .rgPagerTextBox{
    width: 20px !important;
    }

    Let me know if that helps.

    -Todd
Back to Top