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

[Solved] SEOPagingQueryStringKey not working with other QueryString values

6 Answers 142 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nate Pinchot
Top achievements
Rank 1
Nate Pinchot asked on 02 Feb 2009, 11:15 PM
Hello,
I am attempting to use SEOPagingQueryStringKey on the RadGrid but whenever I enable SEO Paging my grid says that there are no records whenever the SEOPagingQueryStringKey appears in the URL. If I use SEOPagingQueryStringKey on the MasterTableView it works. I don't get it? I am using this incorrectly?
I am using the latest version (Q3 2008) of the controls.
I am using the OnNeedDataSource event to populate the results of the grid through codebehind from an OracleDataReader.
Again it works fine if I set the SEOPagingQueryStringKey and EnableSEOPaging on the PagerStyle of the MasterTableView just not if I set it on the RadGrid.
The only reason I posted this is because I spent a few hours ripping my hair out trying to figure out what I was doing wrong.
Thanks
Nate

6 Answers, 1 is accepted

Sort by
0
Nate Pinchot
Top achievements
Rank 1
answered on 02 Feb 2009, 11:17 PM
PS. I meant to mention in my first post that the SEOPagingQueryStringKey and EnableSEOPaging work fine on the RadGrid whenever there are not other QueryString values. It is when other QueryString values are introduced that it breaks the population of the grid.
0
Nikolay Rusev
Telerik team
answered on 03 Feb 2009, 03:46 PM
Hello Nate,

Indeed we are aware of this issue.
It is logged as a bug and fix will be provided as soon as possible.

Sincerely yours,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
p3mek
Top achievements
Rank 1
answered on 05 May 2009, 05:07 AM
Hi Telerik

Any progress on a fix for this issue?

Michael
0
Nikolay Rusev
Telerik team
answered on 08 May 2009, 06:00 AM
Hello Michael,

For your convenience I am attaching sample application.
Please try the application it should work properly.

Kind regards,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Abdullah Önden
Top achievements
Rank 1
answered on 07 Oct 2009, 02:45 PM
The problem is still continue..

Here's my URL and parameters, when I click the pager items it just reloads the first page everytime?

/Search.aspx?guid=f698f1f2-5f5b-44cd-8db4-75eee47623e6&CatID=&Text=a&ctl00_Dock22_C_ctl00_grdProductsChangePage=2

Here's my code part:

<telerik:RadGrid ID="grdProducts" 
        runat="server"  
        GridLines="None"  
        AllowPaging="true" 
        PageSize="6"  
        ShowHeader="false"  
        OnPreRender="grdProducts_PreRender" 
        OnNeedDataSource="grdProducts_NeedDataSource"  
        onitemcreated="grdProducts_ItemCreated"
         
        <MasterTableView TableLayout="Fixed"
            <PagerStyle Mode="NumericPages" PageButtonCount="5" EnableSEOPaging="true"></PagerStyle> 
            <ItemTemplate> 
                <%# (((GridItem)Container).ItemIndex != 0)? "</td></tr></table>" : "" %> 
                <asp:Panel  ID="ItemContainer" CssClass='<%# (((GridItem)Container).ItemType == GridItemType.Item)? "item" : "alternatingItem" %>' 
                    runat="server"
                     
                    <div style="padding:10px"
                        <center> 
                        <img src="<%= SiteManager.Params.ProductImageFolder%>/<%# Eval("DefaultImageFileName") %>"/> 
                        </center> 
                    </div> 
                    <div style="color:#336699;"
                        <center> 
                        <href="ProductDetails.aspx?ProductID=<%# Eval("ProductID")%>"><b><%# Eval("ProductName")%></b></a> 
                        </center>  
                    </div> 
                    <div > 
                        <table align="center" style="color:#ea552a; margin-top:-5px;"
                            <tr> 
                                <td><b>500 TL</b></td
                                <td>+kdv</td> 
                            </tr> 
                        </table> 
                    </div> 
 
                </asp:Panel> 
            </ItemTemplate> 
            <RowIndicatorColumn Visible="False" UniqueName="RowIndicator"
                </RowIndicatorColumn> 
        </MasterTableView> 
        <GroupingSettings CaseSensitive="false" /> 
    </telerik:RadGrid> 

and code behind:

    private int itemCount; 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        grdProducts.MasterTableView.PagerStyle.Position = GridPagerPosition.TopAndBottom; 
        grdProducts.MasterTableView.NoMasterRecordsText = "<div style='margin:100px;'><b>Aradığınız kelimeye uygun hiçbir sonuç bulunamadı.</b></div>"
        grdProducts.MasterTableView.PagerStyle.EnableSEOPaging = true
 
        if(!IsPostBack) 
        { 
            AjaxManager.AjaxSettings.AddAjaxSetting(grdProducts, grdProducts, AjaxLoadingPanel); 
        } 
    } 
 
    private void PopulateSearchPanel() 
    { 
        string searchID = StringUtil.GetQueryString("guid"); 
        List<ProductItem> products = ProductSearchFactory.GetSearchedProducts(searchID); 
        itemCount = products.Count; 
        foreach (ProductItem p in products) 
        { 
            var productItem = new RadPanelItem(); 
            pproductItem.Text = p.ProductName; 
            productItem.NavigateUrl = "#"
        } 
 
        grdProducts.DataSource = products;         
    } 
 
    protected void grdProducts_PreRender(object sender, EventArgs e) 
    { 
        foreach (GridItem item in ((RadGrid) sender).Items) 
        { 
            if (item is GridDataItem && item.ItemIndex < itemCount - 1) 
            { 
                ((item as GridDataItem)["ProductID"] as TableCell).Controls.Add(new LiteralControl("<table style='display:none;'><tr><td>")); 
            } 
        } 
    } 
 
    protected void grdProducts_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
    { 
        PopulateSearchPanel(); 
    } 
 
    protected void grdProducts_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridPagerItem) 
        { 
            GridPagerItem item = (GridPagerItem)e.Item; 
            Control numericPager = item.GetNumericPager(); 
            item.PagerContentCell.Controls.Clear(); 
 
            Panel numericHolder = new Panel(); 
            numericHolder.CssClass = "NumericPagerHolder"
            Label label = new Label {CssClass = ((Panel) numericPager).CssClass, Text = ""}; 
            numericHolder.Controls.Add(label); 
            numericHolder.Controls.Add(numericPager); 
            item.PagerContentCell.Controls.Add(numericHolder); 
        } 
    } 
 
    #region MyPager 
    private class MyPager : Control 
    { 
        private GridPagingManager paging; 
        private GridTableView tableView; 
 
        TextBox textBox; 
        RangeValidator rangeValidator; 
 
        public MyPager(GridPagingManager paging, GridTableView tableView) 
        { 
            this.paging = paging; 
            this.tableView = tableView; 
 
            this.EnsureChildControls(); 
        } 
 
        private void BtnClick(object sender, EventArgs e) 
        { 
            if (this.textBox.Text.Trim() != "") 
            { 
                this.tableView.CurrentPageIndex = int.Parse(this.textBox.Text) - 1; 
                this.tableView.Rebind(); 
            } 
        } 
    } 
    #endregion 




0
Nikolay Rusev
Telerik team
answered on 12 Oct 2009, 11:58 AM
Hello Abdullah,

Did you tried the code that I have send you on my last post? It seems that it is working  properly on my end. Please give it a try and if you are still having issues open formal support ticket with runnable application attached to it to demonstrates the issues that you are experience.

Best wishes,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Nate Pinchot
Top achievements
Rank 1
Answers by
Nate Pinchot
Top achievements
Rank 1
Nikolay Rusev
Telerik team
p3mek
Top achievements
Rank 1
Abdullah Önden
Top achievements
Rank 1
Share this question
or