Hello,
Is there a way to have a RadGrid slider pagination control have its control and text on the same line. With PagerStyle Mode="Slider" I am getting the 'Page: X out of Y pages" text under the slider control - which works fine - Ideally I'd like to occupy less vertical space by having this same text but instead to the right of the slider...
Thanks in advance!
C#, VS2008, latest asp.net telerik libs
3 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 25 Feb 2009, 06:54 AM
Hi,
Try out the following code to access the slider and place it in the panel that holds the pager text for the pager row:
cs:
Thanks
Princy.
Try out the following code to access the slider and place it in the panel that holds the pager text for the pager row:
cs:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridPagerItem) |
{ |
GridPagerItem pager = (GridPagerItem)e.Item; |
//access the slider |
RadSlider slider = (RadSlider)pager.Controls[0].Controls[1]; |
//Add the slider to the panel containing the pager text |
((System.Web.UI.WebControls.Panel)(pager.Controls[0].Controls[0])).Controls.Add(slider); |
} |
} |
Thanks
Princy.
0
ajenski
Top achievements
Rank 1
answered on 25 Feb 2009, 04:07 PM
Thanks for the quick response. That worked. I added this to the RadGrid settings
<ClientSettings ClientMessages-PagerTooltipFormatString=" Displaying Page {0} of {1}" />
in order to give some space between the slider control and the text displaying to the right of the slider.
Is it possible to put an export as.. Excel button in this same pager area? (if so how)
thanks again!
0
Princy
Top achievements
Rank 2
answered on 26 Feb 2009, 04:29 AM
Hello,
You can either try out the following code to add a button in the pager row:
cs:
(OR) You can use a PagerTemplate wherein you can add a RadSlider, button or any other control. Refer to the following demo which shows an example using PagerTemplate:
Pager template
Thanks
Princy.
You can either try out the following code to add a button in the pager row:
cs:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridPagerItem) |
{ |
Button btn = new Button(); |
btn.ID = "Button1"; |
btn.Text = "Export"; |
btn.Click += new EventHandler(btn_Click); |
GridPagerItem pager = (GridPagerItem)e.Item; |
RadSlider slider = (RadSlider)pager.Controls[0].Controls[1]; |
((System.Web.UI.WebControls.Panel)(pager.Controls[0].Controls[0])).Controls.Add(slider); |
((System.Web.UI.WebControls.Panel)(pager.Controls[0].Controls[0])).Controls.Add(btn); |
} |
} |
protected void btn_Click(object sender, EventArgs e) |
{ |
//code to export |
} |
(OR) You can use a PagerTemplate wherein you can add a RadSlider, button or any other control. Refer to the following demo which shows an example using PagerTemplate:
Pager template
Thanks
Princy.