When I add datapager the paging and sorting does not work

2 posts, 0 answers
  1. Tareq
    Tareq avatar
    1 posts
    Member since:
    Apr 2013

    Posted 23 Apr 2013 Link to this post


    I followed the code example from here: http://demos.telerik.com/aspnet-ajax/grid/examples/programming/alphabeticpaging/defaultvb.aspx?#qsf-demo-source

    Now the Alpha paging works great but the numeric paging when I click on any page it comes completely balnk
    When I click on enable sorting and click on it comes blank

    Is there something missing in the demo site code
    <%@ Page Title="" Language="VB" MasterPageFile="~/AdminPanel/Admin.master" AutoEventWireup="false" CodeFile="pager_test.aspx.vb" Inherits="AdminPanel_franchise_pager_test" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                <telerik:AjaxSetting AjaxControlID="RadGrid2">
                        <telerik:AjaxUpdatedControl ControlID="RadGrid2"></telerik:AjaxUpdatedControl>
        <br />
        <hr />
        <div style="border: 5px solid #eaf2fd; width: 95%;">
            <telerik:RadGrid ID="RadGrid2" DataSourceID="SqlDataSource2" AllowPaging="True" PageSize="5"
                runat="server" GridLines="None" Width="100%" AllowSorting="True"
                <PagerStyle Mode="NextPrevAndNumeric" EnableSEOPaging="False"></PagerStyle>
                <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
                <ItemStyle HorizontalAlign="Center"></ItemStyle>
                <AlternatingItemStyle HorizontalAlign="Center"></AlternatingItemStyle>
                <MasterTableView CommandItemDisplay="Top">
    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"
    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                        <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
    <FilterMenu EnableImageSprites="False"></FilterMenu>
        <br />
        <asp:SqlDataSource ID="SqlDataSource2" runat="server"  ConnectionString="<%$ ConnectionStrings:SQL %>"
            SelectCommand="SELECT [a], [b], [c], [d], [e] FROM [franchises] WHERE ([xyz] LIKE @xyz)">
                <asp:Parameter Name="xyz" Type="String" DefaultValue="%" />

    Protected Sub RadGrid2_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles RadGrid2.ItemCreated
           If TypeOf e.Item Is GridCommandItem Then
               Dim commandItem As GridCommandItem = CType(e.Item, GridCommandItem)
               Dim container As PlaceHolder = commandItem.FindControl("PlaceHolder1")
               Dim i As Integer
               For i = 65 To 65 + 25
                   Dim linkButton1 As New LinkButton
                   Dim lc As New LiteralControl("  ")
                   linkButton1.Text = "" + ChrW(i)
                   linkButton1.CommandName = "alpha"
                   linkButton1.CommandArgument = "" + ChrW(i)
               Next i
               Dim lcLast As New LiteralControl(" ")
               Dim linkButtonAll As New LinkButton
               linkButtonAll.Text = "All"
               linkButtonAll.CommandName = "NoFilter"
           End If
       End Sub
       Protected Sub RadGrid2_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles RadGrid2.ItemCommand
           Dim value As String = Nothing
           Select Case e.CommandName
               Case ("alpha")
                   value = String.Format("{0}%", e.CommandArgument)
                   Exit Select
               Case ("NoFilter")
                   value = "%"
                   Exit Select
           End Select
           SqlDataSource2.SelectParameters("xyz").DefaultValue = value
       End Sub

  2. Pavlina
    Pavlina avatar
    6069 posts

    Posted 26 Apr 2013 Link to this post


    I tried to replicate the described problem in our online example, but to no avail. Can you specify what is the difference in your case? Also let us know which is the version of Telerik controls you are using.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top