This is a migrated thread and some comments may be shown as answers.

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

2 Answers 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 05 May 2009, 08:27 PM
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 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 May 2009, 04:18 AM
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.
0
Todd Anglin
Top achievements
Rank 2
answered on 06 May 2009, 04:29 AM
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
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Todd Anglin
Top achievements
Rank 2
Share this question
or