MaintainScrollPositionOnPostback not working with RadComboBox

5 posts, 0 answers
  1. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 04 Aug 2010 Link to this post

    Hi,

    The standard .net MaintainScrollPositionOnPostback page attribute does not seem to work with RadComboBox.  It works fine with the standard asp:dropdownlist.  The attached code leaves the user at 'top'.

    <%@ Page Language="C#" AutoEventWireup="true" MaintainScrollPositionOnPostback="true" CodeBehind="WebForm7.aspx.cs" Inherits="MyProject.WebForm7" %>
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            </telerik:RadScriptManager>
        <p>top</p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <telerik:RadComboBox ID="rcb1" runat="server" AutoPostBack="true">
            <Items>
                <telerik:RadComboBoxItem Text="one" />
                <telerik:RadComboBoxItem Text="two" />
            </Items>
        </telerik:RadComboBox>
        </div>
      
        </form>
    </body>
    </html>

    And this code returns the user to the bottom of the page:

    <%@ Page Language="C#" AutoEventWireup="true" MaintainScrollPositionOnPostback="true" CodeBehind="WebForm7.aspx.cs" Inherits="MyProject.WebForm7" %>
      
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            </telerik:RadScriptManager>
        <p>top</p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <p> </p>
        <asp:DropDownList ID="dl1" runat="server" AutoPostBack="true">
            <asp:ListItem Text="one"></asp:ListItem>
            <asp:ListItem Text="two"></asp:ListItem>
        </asp:DropDownList>
        </div>
      
        </form>
    </body>
    </html>

    I am using version 2010.2.713.40.

    Is this a known issue with RadComboBox?

    Thanks.
  2. John Fabian
    John Fabian avatar
    1 posts
    Member since:
    Dec 2009

    Posted 05 Aug 2010 Link to this post

    I'm having the same issue ?? no problem with regular .net controls but the RadCombobox is ignoring the maintainScrollPositionOnPostback="true" in the page directive. The page jumps to the top when changing selected items.
  3. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 06 Aug 2010 Link to this post

    Hi there,

    We recently found a similar issue in RadComboBox however I was unable to reproduce it with your code.

    Please try putting the following code on your pages:
    Telerik.Web.UI.RadComboBox.prototype.postback = function (command) {
        if (!this._postBackReference) return;
        var postbackFunction = this._postBackReference.replace("arguments",
            Sys.Serialization.JavaScriptSerializer.serialize(command));
        if (Telerik.Web.UI.RadComboBox.isIEDocumentMode8())
            this.get_element().focus();
        eval(postbackFunction);
    };

    If it works, then then you can download the latest internal build to obtain the fixed version.

    Sincerely yours,
    Simon
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 06 Aug 2010 Link to this post

    Hi Simon,

    Yes, adding that code fixed it for me in my test page.  When will this fix be publically available?

    Thanks,

    Craig
  5. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 11 Aug 2010 Link to this post

    Hello Craig Wallace,

    The fix is already included in the latest internal build. You can download it from your account (Downloads -> Latest Internal Builds).

    Greetings,
    Simon
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top