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

Pager Template with Slider

2 Answers 64 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Levi
Top achievements
Rank 1
Levi asked on 30 Oct 2008, 07:24 PM
Do you guys have any examples of incorporating a slider into a pager template? I know you have a slider setting for your standard pager, but i have a template in which I want to place the slider in between the back and forward buttons. My template looks fine of course, but needs to be wired to the pager navigation and I was hoping maybe you guys already had a sample of this.

Thanks!
Levi

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 31 Oct 2008, 05:18 AM
Hi Levi,

Try adding the RadSlider in the PagerTemplate of the Grid as shown below.

ASPX:
<PagerTemplate> 
      <telerik:RadSlider ID="RadSlider1" runat="server" AutoPostBack="True"  OnValueChanged="RadSlider1_ValueChanged" Skin="Office2007" /> 
  </PagerTemplate> 

CS:
  protected void RadSlider1_ValueChanged(object sender, EventArgs e) 
    { 
        RadSlider pageSlider = (RadSlider)sender; 
        RadGrid1.CurrentPageIndex = pageSlider.Value; 
        RadGrid1.MasterTableView.Rebind(); 
         
    } 


Thanks
Shinu.
0
Levi
Top achievements
Rank 1
answered on 03 Nov 2008, 04:42 PM
How would I go about setting the max value of the slider using OnNeedDataSource or Page Load? I've tried several methods to find the slider into the RadGrid but have had no luck. Findcontrol does not work as it seems to have multiple child containers like "ct100", etc. I also tried FindControl on the PagerPanel, which cannot seem to be found either. My entire grid is in a Dynamically loaded user control. Here is my markup:

 

<MasterTableView TableLayout="Fixed" OverrideDataSourceControlSorting="true">

 

 

<PagerTemplate>

 

 

<asp:Panel ID="PagerPanel" Style="padding: 6px;" runat="server">

 

 

<span style="margin-top: 2px; float: left; margin-right: 3px;">Page size:</span>

 

 

<telerik:RadComboBox ID="RadComboBox1" DataSource="<%# new object[]{10, 20, 30, 40, 50} %>"

 

 

Style="margin-top: 2px; float: left; vertical-align: baseline; margin-right: 20px;"

 

 

Skin="Vista" Width="40px" SelectedValue='<%# DataBinder.Eval(Container, "Paging.PageSize") %>'

 

 

OnClientSelectedIndexChanged="setPageSize" AssignedGrid="RadGridSummary" runat="server"

 

 

Font-Size="11px">

 

 

</telerik:RadComboBox>

 

 

<div style="float: right;">

 

Displaying page

<%

# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>

 

of

<%

# DataBinder.Eval(Container, "Paging.PageCount")%>, items from

 

<%

# (int)DataBinder.Eval(Container, "Paging.FirstIndexInPage") + 1 %>

 

to

<%

# (int)DataBinder.Eval(Container, "Paging.LastIndexInPage") + 1 %>

 

of

<%

# DataBinder.Eval(Container, "Paging.DataSourceCount")%>.

 

 

</div>

 

 

<div style="float: left">

 

 

<asp:Button ID="Button1" runat="server" OnClientClick="changePage('first'); return false;"

 

 

CommandName="Page" CommandArgument="First" CssClass="PagerButton FirstPage" Text=" << " />

 

 

<asp:Button ID="Button2" runat="server" OnClientClick="changePage('prev'); return false;"

 

 

CommandName="Page" CommandArgument="Prev" CssClass="PagerButton PrevPage" Text=" < " />

 

 

</div>

 

 

<div style="float: left; margin-left: 5px; margin-right: 5px; margin-top: 4px;">

 

 

<telerik:RadSlider ID="RadSlider1" Length="150" Skin="Vista" AutoPostBack="True" OnValueChanged="RadSlider1_ValueChanged" runat="server" />

 

 

</div>

 

 

<div style="float: left">

 

 

<asp:Button ID="Button3" runat="server" OnClientClick="changePage('next'); return false;"

 

 

CommandName="Page" CommandArgument="Next" CssClass="PagerButton NextPage" Text=" > " />

 

 

<asp:Button ID="Button4" runat="server" OnClientClick="changePage('last'); return false;"

 

 

CommandName="Page" CommandArgument="Last" CssClass="PagerButton LastPage" Text=" >> " />

 

 

</div>

 

 

</asp:Panel>

 

 

</PagerTemplate> 

 

 

protected void RadGridSummary_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)

 

{

RadGridSummary.VirtualItemCount =

Visitor.GetVisitDataCount(SiteId, DateFilter);

 

 

int startRowIndex = (ShouldApplySortFilterOrGroup()) ?

 

0 : RadGridSummary.CurrentPageIndex * RadGridSummary.MasterTableView.PageSize;

 

int maximumRows = (ShouldApplySortFilterOrGroup()) ?

 

 

Visitor.GetVisitDataCount(SiteId, DateFilter) : RadGridSummary.MasterTableView.PageSize;

 

RadGridSummary.AllowCustomPaging = !ShouldApplySortFilterOrGroup();

RadGridSummary.DataSource =

Visitor.GetVisitData(SiteId, DateFilter, startRowIndex, maximumRows).Data;

 

}

 

Any help in finding "RadSlider1" would be greatly appreciated.

Thanks,
Levi

Tags
Grid
Asked by
Levi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Levi
Top achievements
Rank 1
Share this question
or