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

[Solved] Problem with default value for PageSize in PagerStyle

2 Answers 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Flea#
Top achievements
Rank 1
Flea# asked on 14 May 2009, 07:44 PM
Hello,

I have a rad grid with the following pager style settings:

<PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true" /> 

When the rad grid is displayed on the page; if there is no data to display in the grid, the text box that has the page size set to 10 is not wide enough to display 10, it cuts off half of the 0.

When you add a record, the page size is smart enough to just be "1" and when you add over ten records; the box expands to display "10" correctly.

It seems to be a problem when there is no records to display, it then cuts the 0 off. Seems like a bug in the control, but didn't know if I was missing something.

Thanks,
Flea#

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 15 May 2009, 05:41 AM
Hello Flea#,

You can try outt eh following code to access the RadNumeriCTextBox in the pager row and set a constant width for the control:
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
Flea#
Top achievements
Rank 1
answered on 20 May 2009, 04:37 PM
Thanks Princy, that worked great! I had to use it for the ChangePageSizeTextBox instead; but the code was none the less the same!

Thanks,
Flea#
Tags
Grid
Asked by
Flea#
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Flea#
Top achievements
Rank 1
Share this question
or