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

Slider Pager on narrow grid - Page x of Y overwrites Items X to Y of Z

1 Answer 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 16 Mar 2015, 09:49 PM
In a fairly narrow RadGrid, PagerStyle is set to Slider, but the slider bar is so wide that when you go to a new page, the Page X of Y label overwrites the Items X to Y of Z label. 

How can the width of the slider bar be defined so as to prevent this?  I was able to programmatically set it via some JavaScript, but the amount the selector moves per page is off and when you get to Page Y of Y, it still overwrites the Next Page button

The basic issue is in the attached image

1 Answer, 1 is accepted

Sort by
0
Accepted
Venelin
Telerik team
answered on 19 Mar 2015, 12:56 PM
Hello Richard,

You can change the width of the slider on ItemCreated server event:

C#:

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridPagerItem)
    {
        (e.Item.FindControl("GridSliderPager") as RadSlider).Width = Unit.Pixel(100);
    }
}

Using FindControl method for GridPagerItem you can obtain a reference to the slider and then set the .Width property.

I hope this will prove helpful.

Regards,
Venelin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Richard
Top achievements
Rank 1
Answers by
Venelin
Telerik team
Share this question
or