No record to display msg in page navigation

3 posts, 0 answers
  1. nallamani
    nallamani avatar
    28 posts
    Member since:
    Oct 2008

    Posted 08 Oct 2008 Link to this post

       I am using Slider for the page navigation and it work for all other pages in our project .But I have problem in the below code.It doesnt Shows the records in the second page.I am getting No records to display message even if I have those records displayed in single page if  I am not using the page size option.
    My code....
    Client side.


    <telerik:RadAjaxManager id="RadAjaxManager1" runat="server">






    <telerik:AjaxSetting AjaxControlID="RadGridPages">






    <telerik:AjaxUpdatedControl ControlID="RadGridPages" LoadingPanelID="RadAjaxLoadingPanel1"/>















    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" Width="75px" Transparency="50">



    <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0;" />






    <telerik:RadGrid id="RadGridPages" CssClass="RadGrid" EnableTheming="False" EnableEmbeddedBaseStylesheet="False" AllowSorting="True" AllowMultiRowSelection="true"



    Skin="" runat="server" Width="100%" AllowPaging="True" AutoGenerateColumns="False" PageSize="5" >



    <alternatingitemstyle cssclass="RadGridItem" />



    <ItemStyle CssClass="RadGridItem" ></ItemStyle>



    <HeaderStyle CssClass="RadGridHeader"></HeaderStyle>



    <PagerStyle Mode="Slider" alwaysvisible="True" CssClass="RadGridPager" Visible="true" EnableSEOPaging="True" ></PagerStyle>



    <ClientSettings EnablePostBackOnRowClick="false">



    <Selecting AllowRowSelect="true" />






    <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="False" Width="100%">






    <div style="padding:10px 0px;" class="newtd">&nbsp;&nbsp;&nbsp;



    <asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete the Webpage(s)?')"



    runat="server" CommandName="DeleteSelected" CausesValidation="false" ><img style="border:0px;vertical-align:middle;" alt="" src="../Images/icons/Delet.gif" /> Delete the Webpage(s)</asp:LinkButton>






    <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="../Images/icons/Refresh.gif" /> Refresh </asp:LinkButton>












    <telerik:GridTemplateColumn UniqueName="SrlNo" AllowFiltering="False" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="2%" >



    <ItemTemplate >



    <asp:Label ID="lblSrlNo" runat="server" />&nbsp;&nbsp;



    <asp:Label ID="lblSelectedNew" Text='<%# Container.DataItem("WebSite") & "_" & Container.DataItem("PageName") %>' runat="server" Visible="false"></asp:Label>









    <telerik:GridClientSelectColumn HeaderStyle-Width="3%" />



    <telerik:GridBoundColumn DataField="WebSite" UniqueName="WebSite" ItemStyle-HorizontalAlign="Left" HeaderText="Website" ShowSortIcon="false" ></telerik:GridBoundColumn>



    <telerik:GridBoundColumn DataField="PageName" UniqueName="PageName" ItemStyle-HorizontalAlign="Left" HeaderText="Webpage" ShowSortIcon="false" ></telerik:GridBoundColumn>



    -- <telerik:GridBoundColumn DataField="OriginalLocation" UniqueName="OriginalLocation" HeaderText="Original Location" ItemStyle-HorizontalAlign="Left" ShowSortIcon="false"></telerik:GridBoundColumn>






    <telerik:GridBoundColumn DataField="DeletedDate" UniqueName="DeletedDate" HeaderText="Deleted Date" ItemStyle-HorizontalAlign="Left" ShowSortIcon="false"></telerik:GridBoundColumn>



    <telerik:GridTemplateColumn UniqueName="Restore" HeaderText="Restore" AllowFiltering="False">






    <asp:LinkButton ID="LinkButton2" runat="server" Text="Restore" CommandName="PageName" CommandArgument='<%# Container.DataItem("WebSite") & "_" & Container.DataItem("PageName") %>' ></asp:LinkButton>
















    <HeaderStyle Width="20px"></HeaderStyle>









    <HeaderStyle Width="20px"></HeaderStyle>









    <FilterMenu EnableTheming="True" Skin="WebBlue" enableembeddedbasestylesheet="False">



    <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>








    and my Server side





    Class Clients_ManageRecycled



    Inherits System.Web.UI.Page



    Dim oDb As New CMSDatabase



    Dim SqlQry As String = ""



    Dim ClientName As String = ""



    Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit



    Dim UserTheme As MyThemes = Val(Session("@Theme"))



    Me.Theme = UserTheme.ToString



    End Sub



    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load





    ClientName = oDb.ExecuteScaler(

    "Select DbName from clients where clientid =" & Request.QueryString("CID"))



    ' LinkButton1.Attributes.Add("Onclick", "javascript:return(fn_ValidateDelUsers(this.form));")



    "AppSortOrder") = "Asc"



    "AppSortName") = "Name"




    End Sub



    Protected Sub txtSearch_TextChanged(ByVal sender As Object, ByVal e As EventArgs)



    Dim txt As TextBox = TryCast(DirectCast(sender, TextBox), TextBox)



    Dim list As RadComboBox = DirectCast(((txt.NamingContainer).FindControl("rcbFieldName")), RadComboBox)



    Dim [option] As String



    If list.SelectedValue = "RestorePath" Then


    [option] =

    " = "





    [option] =

    " LIKE "



    End If



    Dim filterExpression As String



    If [option] = " = " Then


    filterExpression =

    "(" + list.SelectedValue + [option] + txt.Text + ")"





    filterExpression =

    "(" + list.SelectedValue + [option] + "'" + txt.Text + "%'" + ")"



    End If


    RadGridPages.MasterTableView.FilterExpression = filterExpression



    End Sub



    Protected Sub RadGridPages_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGridPages.NeedDataSource






    Dim DT As New DataTable



    Dim MysitePath As String = Replace(ConfigurationManager.AppSettings("MapPath"), "/", "\")


    MysitePath = Mid(MysitePath, 1, InStrRev(Mid(MysitePath, 1, Len(MysitePath) - 1),



    MysitePath = MysitePath &

    "_Recycled\" & ClientName & "\"


    hidRecycledPath.Value = MysitePath


    Dim Dir As New DirectoryInfo(MysitePath)



    New Data.DataColumn("PageName"))



    New Data.DataColumn("OriginalLocation"))



    New Data.DataColumn("DeletedDate"))



    New Data.DataColumn("WebSite"))



    Dim DR As Data.DataRow



    For Each Website As DirectoryInfo In Dir.GetDirectories



    For Each WebPage As FileInfo In Website.GetFiles("*.aspx")



    'Response.Write(Website.Name & "\" & WebPage.Name & "<br>")


    DR = DT.NewRow()


    "PageName") = Replace(WebPage.Name, WebPage.Extension, "")



    "OriginalLocation") = Website.Name & "_Stage"



    "DeletedDate") = WebPage.LastWriteTime



    "WebSite") = Website.Name










    RadGridPages.Visible =



    RadGridPages.DataSource = DT


    Catch ex As Exception


    RadGridPages.Visible =



    lblMsg.Text =

    "No File Found"



    End Try




    End Sub



    Protected Sub RadGridPages_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGridPages.ItemDataBound



    If e.Item.ItemType = GridItemType.AlternatingItem Or e.Item.ItemType = Telerik.Web.UI.GridItemType.Item Then



    'e.Item.Cells(3).Text = e.Item.DataSetIndex + 1



    Dim lbl As Label


    lbl =

    CType(e.Item.FindControl("lblSrlNo"), Label)


    lbl.Text = e.Item.ItemIndex + 1


    Dim lblchk As Label


    lblchk =

    CType(e.Item.FindControl("lblSelectedNew"), Label)



    End If



    End Sub



    Protected Sub RadGridPages_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGridPages.ItemCommand



    If e.CommandName = "PageName" Then



    Dim sql As String = ""



    Dim Odt As New DataTable


    sql =

    "select * from " & ClientName & ".dbo.Recycled where WebPageName like '" & e.CommandArgument.ToString.Split("_")(1) & "'"






    If oDb.IsExist(sql) Then


    Odt = oDb.GetDataTable(sql)


    Dim Tree As New ManageTree



    Dim StructID As Decimal



    For Each dr As DataRow In Odt.Rows






    Dim fileOldAspx As New FileInfo(hidRecycledPath.Value & e.CommandArgument.ToString.Split("_")(0) & "\" & e.CommandArgument.ToString.Split("_")(1) & ".aspx")



    Dim fileOldAspxVb As New FileInfo(hidRecycledPath.Value & e.CommandArgument.ToString.Split("_")(0) & "\" & e.CommandArgument.ToString.Split("_")(1) & ".aspx.vb")



    If File.Exists(hidRecycledPath.Value & e.CommandArgument.ToString.Split("_")(0) & "\" & e.CommandArgument.ToString.Split("_")(1) & ".aspx") Then






    "ParentPath") & ".vb")



    End If


    StructID &=

    "," & Tree.CreateWebPage(e.CommandArgument.ToString.Split("_")(1), dr.Item("ParentID"), Request.QueryString("CID"), e.CommandArgument.ToString.Split("_")(0))


    sql =

    "delete from " & ClientName & ".dbo.Recycled where WebPageName like '" & e.CommandArgument.ToString.Split("_")(1) & "'"







    Dim MyLoadscript As String = "parent.fraMnu.AddNode(""" & ClientName & """, """ & StructID & """);"



    Me.GetType, "MyLoadscript", MyLoadscript, True)






    End If



    End If



    End Sub




    Protected Sub RadGridPages_DeleteCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGridPages.DeleteCommand



    Dim Wbpage As Label



    Dim Sql As String



    Dim i As Integer


    Wbpage =

    CType(e.Item.FindControl("lblSelectedNew"), Label)


    File.Delete(hidRecycledPath.Value & Wbpage.Text.Split(

    "_")(0) & "\" & Wbpage.Text.Split("_")(1) & ".aspx")


    File.Delete(hidRecycledPath.Value & Wbpage.Text.Split(

    "_")(0) & "\" & Wbpage.Text.Split("_")(1) & ".aspx.vb")


    Sql =

    "select structureid from " & ClientName & ".dbo.Recycled where WebPageName like '" & Wbpage.Text.Split("_")(1) & "'"



    Dim MyLoadscript As String = "parent.fraMnu.AddNode(""" & ClientName & """, """ & oDb.ExecuteScaler(Sql) & """);"



    Me.GetType, "MyLoadscript", MyLoadscript, True)


    Sql =

    "delete from " & ClientName & ".dbo.Recycled where WebPageName like '" & Wbpage.Text.Split("_")(1) & "'"







    End Sub



    Protected Sub RadGridPages_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGridPages.ItemCreated



    If TypeOf e.Item Is GridPagerItem AndAlso TryCast(sender, RadGrid).PagerStyle.Mode = GridPagerMode.Slider Then



    TryCast(TryCast(e.Item, GridPagerItem).Controls(0).Controls(1), RadSlider).EnableEmbeddedBaseStylesheet = True



    TryCast(TryCast(e.Item, GridPagerItem).Controls(0).Controls(1), RadSlider).EnableEmbeddedSkins = True



    TryCast(TryCast(e.Item, GridPagerItem).Controls(0).Controls(1), RadSlider).Skin = "WebBlue"



    End If



    End Sub





    One more thing this works fine if I change the page navigation mode to other mode other than slider.

    Very urgent...Help me

  2. Kiara
    Kiara avatar
    309 posts
    Member since:
    Jul 2006

    Posted 13 Oct 2008 Link to this post

    nallamani, I took a look at your code but did not find anything wrong with it. My only guess is that you have to debug it step by step to see whether the rows with the data are passed to the grid when paging is started when dragging the slider. Also make sure you use the latest version of RadControls for ASP.NET Ajax (2008.2.1001).

  3. Telerik UI for ASP.NET Core is out
  4. nallamani
    nallamani avatar
    28 posts
    Member since:
    Oct 2008

    Posted 16 Oct 2008 Link to this post

    Still I have the issue....Can you help me with that
Back to Top