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

MaintainScrollPositionOnPostback not working with RadComboBox

4 Answers 104 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Craig Wallace
Top achievements
Rank 1
Craig Wallace asked on 04 Aug 2010, 02:22 PM
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.

4 Answers, 1 is accepted

Sort by
0
John Fabian
Top achievements
Rank 1
answered on 05 Aug 2010, 03:28 PM
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.
0
Simon
Telerik team
answered on 06 Aug 2010, 01:21 PM
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
0
Craig Wallace
Top achievements
Rank 1
answered on 06 Aug 2010, 04:02 PM
Hi Simon,

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

Thanks,

Craig
0
Simon
Telerik team
answered on 11 Aug 2010, 08:58 AM
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
Tags
ComboBox
Asked by
Craig Wallace
Top achievements
Rank 1
Answers by
John Fabian
Top achievements
Rank 1
Simon
Telerik team
Craig Wallace
Top achievements
Rank 1
Share this question
or